A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

ActiveX Toggle Workbook



 
 
Thread Tools Display Modes
  #1  
Old February 21st, 2007, 07:31 PM posted to microsoft.public.excel.worksheet.functions
Scafidel
external usenet poster
 
Posts: 35
Default ActiveX Toggle Workbook

OK. I am using this command to hide/unhide several rows of a sheet that have
nonessential information. As my workbook has many sheets, I would like to be
able to Hide/Unhide rows on ALL the sheets. I know I can copy the command for
each sheet, but there must be an easier way. If possible, by having a "cover
sheet" with a toggle to hide/unhide rows for the entire workbook. If not, is
there a way to include all sheets in the command?

Private Sub ToggleButton1_Click()
With Worksheets("34-01").Rows("45:200")
If .Hidden = True Then
.Hidden = False
Else
.Hidden = True
End If
End With
End Sub

Thanks
Scafidel
  #2  
Old February 21st, 2007, 09:04 PM posted to microsoft.public.excel.worksheet.functions
Gord Dibben
external usenet poster
 
Posts: 20,252
Default ActiveX Toggle Workbook

Private Sub ToggleButton1_Click()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
With ws.Rows("45:200")
If .Hidden = True Then
.Hidden = False
Else
.Hidden = True
End If
End With
Next ws
End Sub


Gord Dibben MS Excel MVP

On Wed, 21 Feb 2007 10:31:00 -0800, Scafidel
wrote:

OK. I am using this command to hide/unhide several rows of a sheet that have
nonessential information. As my workbook has many sheets, I would like to be
able to Hide/Unhide rows on ALL the sheets. I know I can copy the command for
each sheet, but there must be an easier way. If possible, by having a "cover
sheet" with a toggle to hide/unhide rows for the entire workbook. If not, is
there a way to include all sheets in the command?

Private Sub ToggleButton1_Click()
With Worksheets("34-01").Rows("45:200")
If .Hidden = True Then
.Hidden = False
Else
.Hidden = True
End If
End With
End Sub

Thanks
Scafidel


  #3  
Old February 21st, 2007, 09:42 PM posted to microsoft.public.excel.worksheet.functions
Scafidel
external usenet poster
 
Posts: 35
Default ActiveX Toggle Workbook

Thanks again, Gord. How can I omit a sheet (from this command) that I want
to display completely?
Scafidel

"Gord Dibben" wrote:

Private Sub ToggleButton1_Click()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
With ws.Rows("45:200")
If .Hidden = True Then
.Hidden = False
Else
.Hidden = True
End If
End With
Next ws
End Sub


Gord Dibben MS Excel MVP

On Wed, 21 Feb 2007 10:31:00 -0800, Scafidel
wrote:

OK. I am using this command to hide/unhide several rows of a sheet that have
nonessential information. As my workbook has many sheets, I would like to be
able to Hide/Unhide rows on ALL the sheets. I know I can copy the command for
each sheet, but there must be an easier way. If possible, by having a "cover
sheet" with a toggle to hide/unhide rows for the entire workbook. If not, is
there a way to include all sheets in the command?

Private Sub ToggleButton1_Click()
With Worksheets("34-01").Rows("45:200")
If .Hidden = True Then
.Hidden = False
Else
.Hidden = True
End If
End With
End Sub

Thanks
Scafidel



  #4  
Old February 21st, 2007, 10:05 PM posted to microsoft.public.excel.worksheet.functions
Duke Carey
external usenet poster
 
Posts: 1,027
Default ActiveX Toggle Workbook

Private Sub ToggleButton1_Click()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
if ws.name "name of worksheet to skip"
With ws.Rows("45:200")
If .Hidden = True Then
.Hidden = False
Else
.Hidden = True
End If
End With
end if
Next ws
End Sub


"Scafidel" wrote:

Thanks again, Gord. How can I omit a sheet (from this command) that I want
to display completely?
Scafidel

"Gord Dibben" wrote:

Private Sub ToggleButton1_Click()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
With ws.Rows("45:200")
If .Hidden = True Then
.Hidden = False
Else
.Hidden = True
End If
End With
Next ws
End Sub


Gord Dibben MS Excel MVP

On Wed, 21 Feb 2007 10:31:00 -0800, Scafidel
wrote:

OK. I am using this command to hide/unhide several rows of a sheet that have
nonessential information. As my workbook has many sheets, I would like to be
able to Hide/Unhide rows on ALL the sheets. I know I can copy the command for
each sheet, but there must be an easier way. If possible, by having a "cover
sheet" with a toggle to hide/unhide rows for the entire workbook. If not, is
there a way to include all sheets in the command?

Private Sub ToggleButton1_Click()
With Worksheets("34-01").Rows("45:200")
If .Hidden = True Then
.Hidden = False
Else
.Hidden = True
End If
End With
End Sub

Thanks
Scafidel



  #5  
Old February 21st, 2007, 10:28 PM posted to microsoft.public.excel.worksheet.functions
Gord Dibben
external usenet poster
 
Posts: 20,252
Default ActiveX Toggle Workbook

Private Sub ToggleButton1_Click()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
If ws.Name "displayall" Then
With ws.Rows("45:200")
If .Hidden = True Then
.Hidden = False
Else
.Hidden = True
End If
End With
End If
Next ws
End Sub

"displayall" will be edited to your sheet name.

Gord


On Wed, 21 Feb 2007 12:42:02 -0800, Scafidel
wrote:

Thanks again, Gord. How can I omit a sheet (from this command) that I want
to display completely?
Scafidel

"Gord Dibben" wrote:

Private Sub ToggleButton1_Click()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
With ws.Rows("45:200")
If .Hidden = True Then
.Hidden = False
Else
.Hidden = True
End If
End With
Next ws
End Sub


Gord Dibben MS Excel MVP

On Wed, 21 Feb 2007 10:31:00 -0800, Scafidel
wrote:

OK. I am using this command to hide/unhide several rows of a sheet that have
nonessential information. As my workbook has many sheets, I would like to be
able to Hide/Unhide rows on ALL the sheets. I know I can copy the command for
each sheet, but there must be an easier way. If possible, by having a "cover
sheet" with a toggle to hide/unhide rows for the entire workbook. If not, is
there a way to include all sheets in the command?

Private Sub ToggleButton1_Click()
With Worksheets("34-01").Rows("45:200")
If .Hidden = True Then
.Hidden = False
Else
.Hidden = True
End If
End With
End Sub

Thanks
Scafidel




  #6  
Old February 22nd, 2007, 06:45 AM posted to microsoft.public.excel.worksheet.functions
Scafidel
external usenet poster
 
Posts: 35
Default ActiveX Toggle Workbook

Thanks for the quick reply.
Scafidel

"Gord Dibben" wrote:

Private Sub ToggleButton1_Click()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
If ws.Name "displayall" Then
With ws.Rows("45:200")
If .Hidden = True Then
.Hidden = False
Else
.Hidden = True
End If
End With
End If
Next ws
End Sub

"displayall" will be edited to your sheet name.

Gord


On Wed, 21 Feb 2007 12:42:02 -0800, Scafidel
wrote:

Thanks again, Gord. How can I omit a sheet (from this command) that I want
to display completely?
Scafidel

"Gord Dibben" wrote:

Private Sub ToggleButton1_Click()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
With ws.Rows("45:200")
If .Hidden = True Then
.Hidden = False
Else
.Hidden = True
End If
End With
Next ws
End Sub


Gord Dibben MS Excel MVP

On Wed, 21 Feb 2007 10:31:00 -0800, Scafidel
wrote:

OK. I am using this command to hide/unhide several rows of a sheet that have
nonessential information. As my workbook has many sheets, I would like to be
able to Hide/Unhide rows on ALL the sheets. I know I can copy the command for
each sheet, but there must be an easier way. If possible, by having a "cover
sheet" with a toggle to hide/unhide rows for the entire workbook. If not, is
there a way to include all sheets in the command?

Private Sub ToggleButton1_Click()
With Worksheets("34-01").Rows("45:200")
If .Hidden = True Then
.Hidden = False
Else
.Hidden = True
End If
End With
End Sub

Thanks
Scafidel




  #7  
Old February 23rd, 2007, 04:45 PM posted to microsoft.public.excel.worksheet.functions
Scafidel
external usenet poster
 
Posts: 35
Default ActiveX Toggle Workbook

This probably should be a new thread, but I thought I'd go to the well once
more. I am using an ActiveX Togglebutton to hide/unhide rows of nonessential
information on various sheets in a workbook. The button is on a cover sheet
to the workbook. However, the program doesn't "see" all of the pages I would
like to omit from hiding. Only the first Totals* is ignored, not the others.
??
thanks
Scafidel

Private Sub ToggleButton1_Click()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
If ws.Name "Totals-*" Then
If ws.Name "Min*" Then
With ws.Rows("45:200")
If .Hidden = True Then
.Hidden = False
Else
.Hidden = True
End If
End With
End If
End If
Next ws
End Sub


"Scafidel" wrote:

Thanks for the quick reply.
Scafidel

"Gord Dibben" wrote:

Private Sub ToggleButton1_Click()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
If ws.Name "displayall" Then
With ws.Rows("45:200")
If .Hidden = True Then
.Hidden = False
Else
.Hidden = True
End If
End With
End If
Next ws
End Sub

"displayall" will be edited to your sheet name.

Gord


On Wed, 21 Feb 2007 12:42:02 -0800, Scafidel
wrote:

Thanks again, Gord. How can I omit a sheet (from this command) that I want
to display completely?
Scafidel

"Gord Dibben" wrote:

Private Sub ToggleButton1_Click()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
With ws.Rows("45:200")
If .Hidden = True Then
.Hidden = False
Else
.Hidden = True
End If
End With
Next ws
End Sub


Gord Dibben MS Excel MVP

On Wed, 21 Feb 2007 10:31:00 -0800, Scafidel
wrote:

OK. I am using this command to hide/unhide several rows of a sheet that have
nonessential information. As my workbook has many sheets, I would like to be
able to Hide/Unhide rows on ALL the sheets. I know I can copy the command for
each sheet, but there must be an easier way. If possible, by having a "cover
sheet" with a toggle to hide/unhide rows for the entire workbook. If not, is
there a way to include all sheets in the command?

Private Sub ToggleButton1_Click()
With Worksheets("34-01").Rows("45:200")
If .Hidden = True Then
.Hidden = False
Else
.Hidden = True
End If
End With
End Sub

Thanks
Scafidel




  #8  
Old February 23rd, 2007, 06:50 PM posted to microsoft.public.excel.worksheet.functions
Gord Dibben
external usenet poster
 
Posts: 20,252
Default ActiveX Toggle Workbook

Private Sub ToggleButton1_Click()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
If Not ws.Name Like "Totals-*" And _
Not ws.Name Like "Min*" Then
With ws.Rows("45:200")
If .Hidden = True Then
.Hidden = False
Else
.Hidden = True
End If
End With
End If
Next ws
End Sub


Gord

On Fri, 23 Feb 2007 07:45:06 -0800, Scafidel
wrote:

This probably should be a new thread, but I thought I'd go to the well once
more. I am using an ActiveX Togglebutton to hide/unhide rows of nonessential
information on various sheets in a workbook. The button is on a cover sheet
to the workbook. However, the program doesn't "see" all of the pages I would
like to omit from hiding. Only the first Totals* is ignored, not the others.
??
thanks
Scafidel

Private Sub ToggleButton1_Click()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
If ws.Name "Totals-*" Then
If ws.Name "Min*" Then
With ws.Rows("45:200")
If .Hidden = True Then
.Hidden = False
Else
.Hidden = True
End If
End With
End If
End If
Next ws
End Sub


"Scafidel" wrote:

Thanks for the quick reply.
Scafidel

"Gord Dibben" wrote:

Private Sub ToggleButton1_Click()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
If ws.Name "displayall" Then
With ws.Rows("45:200")
If .Hidden = True Then
.Hidden = False
Else
.Hidden = True
End If
End With
End If
Next ws
End Sub

"displayall" will be edited to your sheet name.

Gord


On Wed, 21 Feb 2007 12:42:02 -0800, Scafidel
wrote:

Thanks again, Gord. How can I omit a sheet (from this command) that I want
to display completely?
Scafidel

"Gord Dibben" wrote:

Private Sub ToggleButton1_Click()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
With ws.Rows("45:200")
If .Hidden = True Then
.Hidden = False
Else
.Hidden = True
End If
End With
Next ws
End Sub


Gord Dibben MS Excel MVP

On Wed, 21 Feb 2007 10:31:00 -0800, Scafidel
wrote:

OK. I am using this command to hide/unhide several rows of a sheet that have
nonessential information. As my workbook has many sheets, I would like to be
able to Hide/Unhide rows on ALL the sheets. I know I can copy the command for
each sheet, but there must be an easier way. If possible, by having a "cover
sheet" with a toggle to hide/unhide rows for the entire workbook. If not, is
there a way to include all sheets in the command?

Private Sub ToggleButton1_Click()
With Worksheets("34-01").Rows("45:200")
If .Hidden = True Then
.Hidden = False
Else
.Hidden = True
End If
End With
End Sub

Thanks
Scafidel





  #9  
Old February 23rd, 2007, 07:43 PM posted to microsoft.public.excel.worksheet.functions
Scafidel
external usenet poster
 
Posts: 35
Default ActiveX Toggle Workbook

Thanks, again. Works well.

"Gord Dibben" wrote:

Private Sub ToggleButton1_Click()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
If Not ws.Name Like "Totals-*" And _
Not ws.Name Like "Min*" Then
With ws.Rows("45:200")
If .Hidden = True Then
.Hidden = False
Else
.Hidden = True
End If
End With
End If
Next ws
End Sub


Gord

On Fri, 23 Feb 2007 07:45:06 -0800, Scafidel
wrote:

This probably should be a new thread, but I thought I'd go to the well once
more. I am using an ActiveX Togglebutton to hide/unhide rows of nonessential
information on various sheets in a workbook. The button is on a cover sheet
to the workbook. However, the program doesn't "see" all of the pages I would
like to omit from hiding. Only the first Totals* is ignored, not the others.
??
thanks
Scafidel

Private Sub ToggleButton1_Click()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
If ws.Name "Totals-*" Then
If ws.Name "Min*" Then
With ws.Rows("45:200")
If .Hidden = True Then
.Hidden = False
Else
.Hidden = True
End If
End With
End If
End If
Next ws
End Sub


"Scafidel" wrote:

Thanks for the quick reply.
Scafidel

"Gord Dibben" wrote:

Private Sub ToggleButton1_Click()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
If ws.Name "displayall" Then
With ws.Rows("45:200")
If .Hidden = True Then
.Hidden = False
Else
.Hidden = True
End If
End With
End If
Next ws
End Sub

"displayall" will be edited to your sheet name.

Gord


On Wed, 21 Feb 2007 12:42:02 -0800, Scafidel
wrote:

Thanks again, Gord. How can I omit a sheet (from this command) that I want
to display completely?
Scafidel

"Gord Dibben" wrote:

Private Sub ToggleButton1_Click()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
With ws.Rows("45:200")
If .Hidden = True Then
.Hidden = False
Else
.Hidden = True
End If
End With
Next ws
End Sub


Gord Dibben MS Excel MVP

On Wed, 21 Feb 2007 10:31:00 -0800, Scafidel
wrote:

OK. I am using this command to hide/unhide several rows of a sheet that have
nonessential information. As my workbook has many sheets, I would like to be
able to Hide/Unhide rows on ALL the sheets. I know I can copy the command for
each sheet, but there must be an easier way. If possible, by having a "cover
sheet" with a toggle to hide/unhide rows for the entire workbook. If not, is
there a way to include all sheets in the command?

Private Sub ToggleButton1_Click()
With Worksheets("34-01").Rows("45:200")
If .Hidden = True Then
.Hidden = False
Else
.Hidden = True
End If
End With
End Sub

Thanks
Scafidel






  #10  
Old February 23rd, 2007, 09:06 PM posted to microsoft.public.excel.worksheet.functions
Gord Dibben
external usenet poster
 
Posts: 20,252
Default ActiveX Toggle Workbook

We have to quit meeting like thisg

Gord

On Fri, 23 Feb 2007 10:43:23 -0800, Scafidel
wrote:

Thanks, again. Works well.

"Gord Dibben" wrote:

Private Sub ToggleButton1_Click()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
If Not ws.Name Like "Totals-*" And _
Not ws.Name Like "Min*" Then
With ws.Rows("45:200")
If .Hidden = True Then
.Hidden = False
Else
.Hidden = True
End If
End With
End If
Next ws
End Sub


Gord

On Fri, 23 Feb 2007 07:45:06 -0800, Scafidel
wrote:

This probably should be a new thread, but I thought I'd go to the well once
more. I am using an ActiveX Togglebutton to hide/unhide rows of nonessential
information on various sheets in a workbook. The button is on a cover sheet
to the workbook. However, the program doesn't "see" all of the pages I would
like to omit from hiding. Only the first Totals* is ignored, not the others.
??
thanks
Scafidel

Private Sub ToggleButton1_Click()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
If ws.Name "Totals-*" Then
If ws.Name "Min*" Then
With ws.Rows("45:200")
If .Hidden = True Then
.Hidden = False
Else
.Hidden = True
End If
End With
End If
End If
Next ws
End Sub


"Scafidel" wrote:

Thanks for the quick reply.
Scafidel

"Gord Dibben" wrote:

Private Sub ToggleButton1_Click()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
If ws.Name "displayall" Then
With ws.Rows("45:200")
If .Hidden = True Then
.Hidden = False
Else
.Hidden = True
End If
End With
End If
Next ws
End Sub

"displayall" will be edited to your sheet name.

Gord


On Wed, 21 Feb 2007 12:42:02 -0800, Scafidel
wrote:

Thanks again, Gord. How can I omit a sheet (from this command) that I want
to display completely?
Scafidel

"Gord Dibben" wrote:

Private Sub ToggleButton1_Click()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
With ws.Rows("45:200")
If .Hidden = True Then
.Hidden = False
Else
.Hidden = True
End If
End With
Next ws
End Sub


Gord Dibben MS Excel MVP

On Wed, 21 Feb 2007 10:31:00 -0800, Scafidel
wrote:

OK. I am using this command to hide/unhide several rows of a sheet that have
nonessential information. As my workbook has many sheets, I would like to be
able to Hide/Unhide rows on ALL the sheets. I know I can copy the command for
each sheet, but there must be an easier way. If possible, by having a "cover
sheet" with a toggle to hide/unhide rows for the entire workbook. If not, is
there a way to include all sheets in the command?

Private Sub ToggleButton1_Click()
With Worksheets("34-01").Rows("45:200")
If .Hidden = True Then
.Hidden = False
Else
.Hidden = True
End If
End With
End Sub

Thanks
Scafidel







 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 02:09 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.