View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
joel joel is offline
external usenet poster
 
Posts: 9,101
Default Find. On other sheet

You don't need the after and the other parameters I eliminated.

Dim rngFound As Range

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

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

"kirkm" wrote:


Hi,

I have this working -

Dim rngFound As Range

TheCol = "N"
With Range(theCol & ":" & theCol)
Set rngFound = .Find(What:=mt, after:=.Range("A1"),
LookIn:=xlValues, LookAt:=xlPart, searchorder:=xlByColumns,
searchdirection:=xlNext, MatchCase:=False, matchbyte:=False)
If Not rngFound Is Nothing Then
r = rngFound.Row
End If
End With

It Finds any mt in Column N. But only in the sheet that's open.
I can't quite make it work with a specific Sheet by name. I think
it goes into the Range line.

Could someone show me the syntax, please?

Thanks - Kirk