edo.gv6
08-18-2015, 09:24 PM
Hi Guys,
I am Rere and I newbie in this forum, please teach and guide me.
I have some issue to transform the formula "=IF(BU7="","",VLOOKUP(BU7,'\\192.168.10.26\Data\CoE\[COEKursTemplate.xlsx]Sheet1'!$H$4:$I$8,2,0))" to VBA Excel, I try to combine "ThisWorkbook.Path" and "Application.WorksheetFunction.VLookup" however still not meet the correct code.
This is my last code :
Private Sub bt_rate_Click()
Dim ratedate As Range
Dim Rate As Range
ratedate = Worksheets("IQ").Range("ratedate")
Rate = Worksheets("IQ").Range("rate")
Dim vlookrange As Range
vlookrange = Worksheets("Sheet1").Range("H4:I8")
Dim urlfile As String
urlfile = ThisWorkbook.Path & "\\192.168.10.26\Data\CoE\COEKursTemplate.xlsx" & vlookrange
Rate = Application.WorksheetFunction.VLookup(ratedate, urlfile, 2, 0)
End Sub
Please correct me where I am wrong
Thank you....
I am Rere and I newbie in this forum, please teach and guide me.
I have some issue to transform the formula "=IF(BU7="","",VLOOKUP(BU7,'\\192.168.10.26\Data\CoE\[COEKursTemplate.xlsx]Sheet1'!$H$4:$I$8,2,0))" to VBA Excel, I try to combine "ThisWorkbook.Path" and "Application.WorksheetFunction.VLookup" however still not meet the correct code.
This is my last code :
Private Sub bt_rate_Click()
Dim ratedate As Range
Dim Rate As Range
ratedate = Worksheets("IQ").Range("ratedate")
Rate = Worksheets("IQ").Range("rate")
Dim vlookrange As Range
vlookrange = Worksheets("Sheet1").Range("H4:I8")
Dim urlfile As String
urlfile = ThisWorkbook.Path & "\\192.168.10.26\Data\CoE\COEKursTemplate.xlsx" & vlookrange
Rate = Application.WorksheetFunction.VLookup(ratedate, urlfile, 2, 0)
End Sub
Please correct me where I am wrong
Thank you....