Sub tester1()
Rows(1).Value = "Z"
Range("M1").Value = "A"
Set oWorksheet = ActiveSheet
Range("A:AA").EntireColumn.Hidden = True
vColName = "A"
Set oFound = oWorksheet.Rows(1).Find(vColName, _
LookIn:=xlValues, LookAt:=xlWhole)
If Not oFound Is Nothing Then
Debug.Print oFound.Address
Else
Debug.Print "Not found"
End If
End Sub
This Worked - using xlFormulas rather than xlValues
Sub tester2()
Rows(1).Value = "Z"
Range("M1").Value = "A"
Set oWorksheet = ActiveSheet
Range("A:AA").EntireColumn.Hidden = True
vColName = "A"
Set oFound = oWorksheet.Rows(1).Find(vColName, _
LookIn:=xlFormulas, LookAt:=xlWhole)
If Not oFound Is Nothing Then
Debug.Print oFound.Address
Else
Debug.Print "Not found"
End If
End Sub
of course looking for something produced by a formula would not work.
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.