looping / find

  • Thread starter Thread starter Brian
  • Start date Start date
B

Brian

Hi,
I want to run a function from say sheet1 that will be like a value in the
cell. "textme". I want to find this string from another sheet, say sheet2.
When it finds it, return the row that it found this string.

How would I loop through the column of sheet 2 and find the text that was
selected from sheet 1?
Thanks
 
=MATCH(A2,Sheet2!A:A,0)

where A2 holds that text.

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
is this not corret?
i = WorksheetFunction.Match(Sheet1!A57, Sheet2!A1:A3000, 0)
keeps returning an error?
 
Dim Res as Variant
res = application.match(worksheets("Sheet1").range("a57").value, _
worksheets("Sheet2").range("a1:A3000"), 0)

if iserror(res) then
'no match found
else
msgbox res 'row in sheet2!A1:a3000 that matched Sheet1!A57
end if
 
Back
Top