chk box to filter or hide rows based on value in a column
Thanks for the correction, Tom.
Tom Ogilvy wrote:
Option Explicit
Sub ShowHide()
Dim rng as Range
With Activesheet
set rng = .Range(.Range("A16"),.Range("A16").End(xldown))
End With
set rng = rng.Resize(,2)
Dim CBX As CheckBox
With ActiveSheet
Set CBX = .CheckBoxes(Application.Caller)
If CBX.Value = xlOn Then
rng.AutoFilter Field:=2, Criteria1:="1"
Else
If .AutoFilterMode Then
if .FilterMode then
.ShowAllData
End if
End If
End If
End With
End Sub
Should fix it.
--
Regards,
Tom Ogilvy
"deanop" wrote in message
oups.com...
Thanks Dave for the feedback......I added the propsed code and assigned
to a new forms control chk box.
When the box is checked, the code adds filter drop downs but does not
proceed to filter out the rows.
When the box is unchecked, the code excecution is interrupted because
the .ShowAll Data method fails
Any thoughts on how to overcome.....
Thx, Deano
--
Dave Peterson
|