Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 57
Default Assign macro to check box?

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,942
Default Assign macro to check box?

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

"Munchkin" wrote:

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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Assign macro bryan Excel Programming 2 March 15th 09 12:30 AM
Assign a Macro Pendelfin Excel Discussion (Misc queries) 1 January 10th 06 11:35 PM
How do I assign a value to check box in excel [email protected] Excel Worksheet Functions 2 January 3rd 06 10:44 PM
How to assign a macro Mike Excel Discussion (Misc queries) 4 July 5th 05 06:43 AM
still can't assign MACRO grin2000[_11_] Excel Programming 3 June 22nd 04 04:17 AM


All times are GMT +1. The time now is 03:53 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"