View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
kirkm[_8_] kirkm[_8_] is offline
external usenet poster
 
Posts: 166
Default Find. On other sheet


Thanks to you both, you've given me lots of ideas
and I have got it working nicely, including a loop that
looks for more than one instance by updating the range
values.

I just wonder - what if you wanted to check 2 adjacent
columns ?

This fails (so obvously isn't right but I can't think of an
alternative, apart from searching twice)

theCol = "S2:T100"
mt = "RowSRowT"
Do

With Sheets("Sheet1").Range(theCol)
Set rngFound = .Find(What:=mt, _
LookIn:=xlValues, _
LookAt:=xlWhole)

If Not rngFound Is Nothing Then
r = rngFound.Row
End If
End With

I've set up this test condition

Cells(10,"S") = "RowS"
Cells(10,"T") = "RowT"

Thanks - Kirk