VBA Vlookup Problem - Run time error '438'

rsami

New Member
Joined
Nov 17, 2011
Messages
17
i have a problem with a VBA Vlookup function.

consider below pictures relevant to 2 workbooks

this is the sheet which i need to see output ( i have saved it as "test.xlsx" )
Uploaded with ImageShack.com

this is the CSV file which i use to refer the data( i have saved it as "Time Tracking.CSV" )
Uploaded with ImageShack.com

what i wanted to do is
find the today date from "test.xlsx" row 2 and insert the time in front of relevant plant(in A Column) by getting the values from "Time Tracking" Workbook
as an example
if today is 9th then J3 cell should be 10.57

i have written a VBA for this. but it gives me "Run time error '438'" at Vlookup Line.
here i have give the code which i come up with. please help me to find the error and correct it.
much appreciate any comment

Code:
<code>Sub find_time()  Dim i As Integer  Workbooks("test.xlsx").Sheets("sheet1").Activate Rows("2:2").Select Rows("2:2").Find(what:=Date, After:=ActiveCell, LookIn:=xlFormulas, _ lookat:=xlPart, searchorder:=xlByRows, searchdirection:=xlNext, _ MatchCase:=False, searchformat:=False).Activate  For i = 1 To 13  ActiveCell.Offset(i, 0).Activate[B] ActiveCell.Value = Application.WorksheetFunction.VLookup(ActiveCell.End(xlToLeft).Value, Workbooks("Time Tracking").Range("A2:C13"), 3, False)[/B] On Error Resume Next ActiveCell.Offset(-i, 0).Activate   Next i   End Sub</code></pre>
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.

Forum statistics

Threads
1,224,545
Messages
6,179,432
Members
452,915
Latest member
hannnahheileen

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top