Olivia Grant
New Member
- Joined
- Mar 11, 2015
- Messages
- 5
I am trying to reset/clear multiple sheets in an excel document as well as resetting the toggle buttons to "True".
I can get the information to clear from all sheets and the toggles to reset on the active sheet but can't get the toggles from the 2 others sheets to reset. My clear button is on the "Paid" Sheet. I get Run-time error '1004': Select method of Range class failed. When I debug, it takes me to where I initially created my toggle and highlights ".Select":
Private Sub ToggleButton1_Click()
With Rows("11:11")
.Select
.EntireRow.Hidden = Not .EntireRow.Hidden
End With
End Sub
Below is the macro attached to my clear form button and the lines giving me issues.
Private Sub CommandButton1_Click()
Sheets("Paid").Range("E10:E296").Value = ""
Sheets("Unpaid").Range("E10:E186").Value = ""
Sheets("Pending").Range("E10:E26").Value = ""
ActiveSheet.CommunityRelations.Value = True
ActiveSheet.Digital.Value = True
Sheets("Unpaid").ToggleButton1.Value= True
Sheets("Pending").ToggleButton1.Value= True
MsgBox "Form has been cleared."
End Sub
Thanks for any help you can give!
I can get the information to clear from all sheets and the toggles to reset on the active sheet but can't get the toggles from the 2 others sheets to reset. My clear button is on the "Paid" Sheet. I get Run-time error '1004': Select method of Range class failed. When I debug, it takes me to where I initially created my toggle and highlights ".Select":
Private Sub ToggleButton1_Click()
With Rows("11:11")
.Select
.EntireRow.Hidden = Not .EntireRow.Hidden
End With
End Sub
Below is the macro attached to my clear form button and the lines giving me issues.
Private Sub CommandButton1_Click()
Sheets("Paid").Range("E10:E296").Value = ""
Sheets("Unpaid").Range("E10:E186").Value = ""
Sheets("Pending").Range("E10:E26").Value = ""
ActiveSheet.CommunityRelations.Value = True
ActiveSheet.Digital.Value = True
Sheets("Unpaid").ToggleButton1.Value= True
Sheets("Pending").ToggleButton1.Value= True
MsgBox "Form has been cleared."
End Sub
Thanks for any help you can give!