Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'm using the following code to retrieve values from a second workbook
- the data is sorted in the second workbook. I've run the macro using F8 and after a few successful retrievals within the loop, when a target is not found in the second workbook the run time error 1004 is reported. Sheets("Hidden").Select Range("j1").Select For n = 1 To NumRows - 1 ActiveCell.Offset(1, 0).Select ActiveCell.Formula = Application.WorksheetFunction.VLookup(Range("i" & n + 1), _ Workbooks(mshare).Sheets("Sheet1").Range("$A:$Z"), 7, False) Next n If I omit the false condition the macro runs through but on examination, where no match has been found, a result is taken from another row. I'd like to return a "Not in second workbook" where a match is not found. Is this possible? I'd appreciate any assistance, Bob Golightly Nottingham, UK |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
vlookup using different workbooks | Excel Discussion (Misc queries) | |||
VLOOKUP 2 workbooks | Excel Discussion (Misc queries) | |||
Vlookup between two workbooks | Excel Worksheet Functions | |||
VLookup across Workbooks? | Excel Worksheet Functions | |||
Help with Vlookup to several workbooks | Excel Programming |