Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
What kind of checkboxes - control toolbox toolbar or forms toolbar
-- Regards, Tom Ogilvy Cindy wrote in message ... 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. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Forms toolbar.
Thanks for the reply. Cindy Johnson ----- Tom Ogilvy wrote: ----- What kind of checkboxes - control toolbox toolbar or forms toolbar -- Regards, Tom Ogilvy Cindy wrote in message ... 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. |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I think I'd use two macros.
The first macro would hide the row (and associated checkbox) and the second would unhide both the rows and the checkboxes. Option Explicit Sub HideRow() Dim myCBX As CheckBox For Each myCBX In ActiveSheet.CheckBoxes With myCBX .Visible = CBool(.Value = xlOn) .TopLeftCell.EntireRow.Hidden = CBool(.Value = xlOff) End With Next myCBX End Sub Sub ShowCBX() With ActiveSheet .Rows.Hidden = False .CheckBoxes.Visible = True End With End Sub Cindy wrote: Forms toolbar. Thanks for the reply. Cindy Johnson ----- Tom Ogilvy wrote: ----- What kind of checkboxes - control toolbox toolbar or forms toolbar -- Regards, Tom Ogilvy Cindy wrote in message ... 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. -- Dave Peterson |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Thanks Dave! I'll attempt to write this Cindy Johnso ----- Dave Peterson wrote: ---- I think I'd use two macros The first macro would hide the row (and associated checkbox) and the secon would unhide both the rows and the checkboxes Option Explici Sub HideRow( Dim myCBX As CheckBo For Each myCBX In ActiveSheet.CheckBoxe With myCB .Visible = CBool(.Value = xlOn .TopLeftCell.EntireRow.Hidden = CBool(.Value = xlOff End Wit Next myCB End Su Sub ShowCBX( With ActiveShee .Rows.Hidden = Fals .CheckBoxes.Visible = Tru End With End Su Cindy wrote Forms toolbar Thanks for the reply Cindy Johnso ----- Tom Ogilvy wrote: ---- What kind of checkboxes - control toolbox toolbar or forms toolba - Regards Tom Ogilv Cindy wrote in messag .. 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 d this? Thanks -- Dave Peterso |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Dave I am attempting to create this macro as you suggested, but I am having a problem see below Sub HideRow( Dim myCBX As CheckBo For Each myCBX In ActiveSheet.CheckBoxe With myCBX When I get to this point and hit enter, I get an error message that says "Compile Error: Action will reset your project, proceed anyway For give my ignorance, but I am no programmer Please help Cind ----- Cindy Johnson wrote: ---- Thanks Dave! I'll attempt to write this Cindy Johnso ----- Dave Peterson wrote: ---- I think I'd use two macros The first macro would hide the row (and associated checkbox) and the secon would unhide both the rows and the checkboxes Option Explici Sub HideRow( Dim myCBX As CheckBo For Each myCBX In ActiveSheet.CheckBoxe With myCB .Visible = CBool(.Value = xlOn .TopLeftCell.EntireRow.Hidden = CBool(.Value = xlOff End Wit Next myCB End Su Sub ShowCBX( With ActiveShee .Rows.Hidden = Fals .CheckBoxes.Visible = Tru End With End Su Cindy wrote Forms toolbar Thanks for the reply Cindy Johnso ----- Tom Ogilvy wrote: ---- What kind of checkboxes - control toolbox toolbar or forms toolba - Regards Tom Ogilv Cindy wrote in messag .. 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 d this? Thanks -- Dave Peterso |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
collapse rows into one | Excel Discussion (Misc queries) | |||
how do i expand and collapse rows | New Users to Excel | |||
Collapse Rows? | Excel Discussion (Misc queries) | |||
Collapse rows with duplicates | Excel Worksheet Functions | |||
delete columns and rows-cells equalling zero or any selected value | Excel Worksheet Functions |