M
Marc
Someone gave me this macro:
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
When I run it as is I get an error in the third line "If CheckBox1.Value =
True Then" "Run time '424': Object required". I change the name of the
check box back to from CheckBox1 but even when I changed it back I still get
the same error message. What is the purpose of the "Range("A1").Select "?
Is it the range of the cells that are to be hidden? I realize these are
very basic of questions. I need to have a macro that hides and unhides
columns and rows that are spread over several worksheets and several
worksheets themselves. I have renamed the checkboxes to correspond to the
task that they are doing i.e.cbxSelAudioHideUnhide. For the line
"Selection.EntireRow.Hidden = True" I have used:
Sheets(Sheet03).Select
Rows("11:34").Select
Selection.EntireRow.Hidden = True
Sheets(Sheet04).Select
Rows("10:28").Select
Selection.EntireRow.Hidden = True
Sheets(Sheet09).Select
Rows("12:35").Select
Selection.EntireRow.Hidden = True
and changed them to the corresponding trues or falses. What do I use for
the range statement?
I do appreciate all your help.
Marc
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
When I run it as is I get an error in the third line "If CheckBox1.Value =
True Then" "Run time '424': Object required". I change the name of the
check box back to from CheckBox1 but even when I changed it back I still get
the same error message. What is the purpose of the "Range("A1").Select "?
Is it the range of the cells that are to be hidden? I realize these are
very basic of questions. I need to have a macro that hides and unhides
columns and rows that are spread over several worksheets and several
worksheets themselves. I have renamed the checkboxes to correspond to the
task that they are doing i.e.cbxSelAudioHideUnhide. For the line
"Selection.EntireRow.Hidden = True" I have used:
Sheets(Sheet03).Select
Rows("11:34").Select
Selection.EntireRow.Hidden = True
Sheets(Sheet04).Select
Rows("10:28").Select
Selection.EntireRow.Hidden = True
Sheets(Sheet09).Select
Rows("12:35").Select
Selection.EntireRow.Hidden = True
and changed them to the corresponding trues or falses. What do I use for
the range statement?
I do appreciate all your help.
Marc