G
Guest
I have created a spreadsheet with check boxes. If the box is not checked, then I want to delete/collapse the rows. How do I create a macro to do this??
Thanks.
Thanks.
then I want to delete/collapse the rows. How do I create a macro to doCindy said:I have created a spreadsheet with check boxes. If the box is not checked,
then I want to delete/collapse the rows. How do I create a macro to doCindy said:I have created a spreadsheet with check boxes. If the box is not checked,
Cindy said:Yes the activesheet has checkboxes or should I say had checkboxes until I ran the 1st macro. Nothing seems to bring back the checkbox. At this point you have helped me to accomplish my 1st goal of running a macro to delete the rows that were not selected, so I'm happy with that. Once a sheet has been set for a specific project there should be no reason to bring back any of the rows deleted.
Cindy
----- Dave Peterson wrote: -----
The macro runs against the activesheet. Are you sure that the sheet that is
currently active has checkboxes?
Option Explicit
Sub ShowCBX()
With ActiveSheet
.Rows.Hidden = False
If .CheckBoxes.Count > 0 Then
.CheckBoxes.Visible = True
Else
MsgBox "I think you're on the wrong worksheet"
End If
End With
End Sub
If that's not it, what version of excel are you using and how are you excuting
the macro--a button from the control toolbox toolbar placed on the worksheet?
(If you're using xl97 and yes to the control toolbox stuff, then try adding this
line to the top of the code:
activecell.activate
like in this:
Option Explicit
Sub ShowCBX()
With ActiveSheet
activecell.activate
.Rows.Hidden = False
If .CheckBoxes.Count > 0 Then
.CheckBoxes.Visible = True
Else
MsgBox "I think you're on the wrong worksheet"
End If
End With
End Sub