Z
Zak
I got this sample code from a website, i tried to use it for my needs but it
does not work. This code stops at the first event of finding something that
matches.. id like excel to continue looking and gather all results and put
them in 1 new sheet. how can i modify the code to do what i want i to?
I am looking up column C in a master sheet into another workbook with 15
sheets, I will be looking up the same column in each sheet, for example,
column c in master sheet will be looked into column c of each of the 15
sheets, it doesnt need to return anything additional other than whether it
appears in any of the sheets, so if i was writing a vlookup it would end with
'1,false'. And ideally the results will be displayed on a new sheet.
Dim wSheet As Worksheet
Dim vFound
On Error Resume Next
For Each wSheet In ActiveWorkbook.Worksheets
With wSheet
Set Tble_Array = .Range(Tble_Array.Address)
vFound = WorksheetFunction.VLookup _
(Look_Value, Tble_Array, _
Col_num, Range_look)
End With
If Not IsEmpty(vFound) Then Exit For
Next wSheet
Set Tble_Array = Nothing
VLOOKAllSheets = vFound
End Function
Thanks a lot for all your help.
does not work. This code stops at the first event of finding something that
matches.. id like excel to continue looking and gather all results and put
them in 1 new sheet. how can i modify the code to do what i want i to?
I am looking up column C in a master sheet into another workbook with 15
sheets, I will be looking up the same column in each sheet, for example,
column c in master sheet will be looked into column c of each of the 15
sheets, it doesnt need to return anything additional other than whether it
appears in any of the sheets, so if i was writing a vlookup it would end with
'1,false'. And ideally the results will be displayed on a new sheet.
Dim wSheet As Worksheet
Dim vFound
On Error Resume Next
For Each wSheet In ActiveWorkbook.Worksheets
With wSheet
Set Tble_Array = .Range(Tble_Array.Address)
vFound = WorksheetFunction.VLookup _
(Look_Value, Tble_Array, _
Col_num, Range_look)
End With
If Not IsEmpty(vFound) Then Exit For
Next wSheet
Set Tble_Array = Nothing
VLOOKAllSheets = vFound
End Function
Thanks a lot for all your help.