Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default Delete/Collapse Rows Not Selected

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Delete/Collapse Rows Not Selected

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default Delete/Collapse Rows Not Selected

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Delete/Collapse Rows Not Selected

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Delete/Collapse Rows Not Selected


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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Delete/Collapse Rows Not Selected


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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
collapse rows into one Vic Excel Discussion (Misc queries) 2 September 21st 09 09:21 PM
how do i expand and collapse rows office wreck! New Users to Excel 7 June 14th 09 08:41 PM
Collapse Rows? LiveUser Excel Discussion (Misc queries) 10 February 6th 08 08:22 PM
Collapse rows with duplicates mlcrane Excel Worksheet Functions 1 August 26th 05 02:27 PM
delete columns and rows-cells equalling zero or any selected value Scottie Excel Worksheet Functions 2 May 9th 05 08:47 PM


All times are GMT +1. The time now is 01:37 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"