Assign macro to check box?

  • Thread starter Thread starter Munchkin
  • Start date Start date
M

Munchkin

Is it possible to make my macro turn on the auto filter when checked, and
turn it off when unchecked?



Rows("3:3").Select
Selection.AutoFilter
Range("A4").Select
End Sub
 
hi
if using a check box from the control tool box, this should work
auto filter is boolean meaning the same command that turns it on also turns
it off if it's on. i removed the select and selection parts...........not
needed.
Private Sub CheckBox1_Click()
If Me.CheckBox1.Value = True Then
'turn of
Rows("3:3").AutoFilter
Range("A4").Select
Else
'turn off
Rows("3:3").AutoFilter
Range("A4").Select
End If
End Sub

regards
FSt1
 
Back
Top