View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
joel joel is offline
external usenet poster
 
Posts: 9,101
Default vlookup or match function across worksheets (x-post - sorry)

SearchValue = "ABC"
Found = False
for each sht in thisworkbook.sheets
if sht.name < "A" then
with thisworkbook.sheets("A")
set c = .Range("A1:A250").find(what:=SearchValue, _
lookin:=xlvalues,lookat:xlwhole)
if not c is nothing then
msgbox("Found in sheet: " & sht.name)
end if
end with
end if

next sht

"Ant" wrote:

For example I have 15 worksheets in an excel workbook named A through
N. I am looking for the values in worksheet A, Cell A1 (through
A250) across worksheets B through N and return the worksheet name
that the value exists in. (Worksheet C for example) The first or any
exact match is fine. If it doesn't exist #N/A is also fine I can work
with the errors returned myself.

Is this possible? If the worksheet name is too difficult then any
valid result (complete path to cell?) is sufficient.

Thank you in advance

(Very sorry for the cross / double post) I feel I might have used the
incorrect group the first time (Not exactly a .MISC)