![]() |
I am so confused! I need help with a check box and a macro.
I am trying to have a check box control whether certain columns, rows and
worksheets are hidden or unhidden. Over at the newusers forum someone gave me a macro that I have tried to modify to make this happen. Private Sub CheckBox1_Click() Range("A1").Select 'Active Cell Select If CheckBox1.Value = True Then Selection.EntireRow.Hidden = True Else: CheckBox1.Value = False Selection.EntireRow.Hidden = False End If End Sub The range should be the columns, rows and worksheets that are to be hidden or unhidden? The Select.Entire Row is what the macro acts on? If I've renamed my check boxes than I should use that name in place on CheckBox1? Any help would be appreciate. Marc |
I am so confused! I need help with a check box and a macro.
hi
this will hide row 1 Private Sub CheckBox1_Click() Columns("A:A").Select Range("A1").Activate 'Active Cell Select If CheckBox1.Value = True Then Range("A1").EntireRow.Hidden = True Else: CheckBox1.Value = False Range("A1").EntireRow.Hidden = False End If End Sub Regards Yngve |
All times are GMT +1. The time now is 08:34 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com