Lookup in numerous sheets

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

using activeworkbook.worksheets 9
vlookup few books 0
vlookallsheets across workbooks 9
vlookup in many books 7
Vlookup VB Help 1
HELP!! Vlookup 0
VBA: Activate sheets within a loop 3
before save event 2

Top