Try this one, it's a toggle on/off
Sub HideInfoRows()
Range("A2").Select
If ActiveSheet.AutoFilterMode = False Then
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="<*info*", Operator:=xlAnd
Else
Selection.AutoFilter
End If
End Sub
hth
Vaya con Dios,
Chuck, CABGx3
"Turquoise_dax" wrote:
I need to use a macro, because it is to be linked to a button.
I tried this code:
ActiveSheet.Columns("B").Select
Selection.AutoFilter Field:=1, Criteria1:="info"
Selection.EntireRow.Hidden = True
but ALL rows get hidden. What is wrong?
--
Turquoise_dax
------------------------------------------------------------------------
Turquoise_dax's Profile: http://www.excelforum.com/member.php...o&userid=35185
View this thread: http://www.excelforum.com/showthread...hreadid=553626