Find value in hiden row

  • Thread starter Thread starter Patrick C. Simonds
  • Start date Start date
P

Patrick C. Simonds

Is there any way to get the code below to find the value NoXXX which is in a
hidden column?

Sub NextRow()
'
' Macro4 Macro
'

'
Cells.Find(What:="NoXXX", After:=ActiveCell, LookIn:=xlValues, LookAt:=
_
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:=False _
, SearchFormat:=False).Activate
End Sub
 
You can't activate a hidden cell. Try this

set c = Cells.Find(What:="NoXXX", After:=ActiveCell, _
LookIn:=xlValues, LookAt:=xlPart)
 
First unhide the columns, second, do the search, third, hide the colums
again.

Sub NextRow()
'
' Macro4 Macro
'

'
ActiveSheet.Columns.Hidden = False
Cells.Find(What:="NoXXX", After:=ActiveCell, _
LookIn:=xlValues, LookAt:=xlPart, _
SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate

'Put code to re-hide columns here

End Sub
 
Back
Top