ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Activex command to Hide/Unhide (https://www.excelbanter.com/excel-worksheet-functions/130968-activex-command-hide-unhide.html)

Scafidel

Activex command to Hide/Unhide
 
I want a toggle button to Hide several rows of Nonessential information. I
can get it to hide the rows, but not unhide or unhide but not hide, but not
both. This is my first try with Activex. I am using this:
Private Sub ToggleButton1_Click()
Worksheets ("34-01") .Rows ("45:200") .Hidden = True
End Sub

That will hide the rows, but I have yet to come up with a command to toggle
hide/unhide.
Thanks
Scafidel

Gord Dibben

Activex command to Hide/Unhide
 
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


Gord Dibben MS Excel MVP

On Thu, 15 Feb 2007 15:28:03 -0800, Scafidel
wrote:

I want a toggle button to Hide several rows of Nonessential information. I
can get it to hide the rows, but not unhide or unhide but not hide, but not
both. This is my first try with Activex. I am using this:
Private Sub ToggleButton1_Click()
Worksheets ("34-01") .Rows ("45:200") .Hidden = True
End Sub

That will hide the rows, but I have yet to come up with a command to toggle
hide/unhide.
Thanks
Scafidel



Scafidel

Activex command to Hide/Unhide
 
Thanks, Gord, you make it look simple!
Scafidel

"Gord Dibben" wrote:

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


Gord Dibben MS Excel MVP

On Thu, 15 Feb 2007 15:28:03 -0800, Scafidel
wrote:

I want a toggle button to Hide several rows of Nonessential information. I
can get it to hide the rows, but not unhide or unhide but not hide, but not
both. This is my first try with Activex. I am using this:
Private Sub ToggleButton1_Click()
Worksheets ("34-01") .Rows ("45:200") .Hidden = True
End Sub

That will hide the rows, but I have yet to come up with a command to toggle
hide/unhide.
Thanks
Scafidel




Gord Dibben

Activex command to Hide/Unhide
 
Thanks for the feedback.

Happy to help where I can.


Gord

On Thu, 15 Feb 2007 17:02:05 -0800, Scafidel
wrote:

Thanks, Gord, you make it look simple!
Scafidel

"Gord Dibben" wrote:

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


Gord Dibben MS Excel MVP

On Thu, 15 Feb 2007 15:28:03 -0800, Scafidel
wrote:

I want a toggle button to Hide several rows of Nonessential information. I
can get it to hide the rows, but not unhide or unhide but not hide, but not
both. This is my first try with Activex. I am using this:
Private Sub ToggleButton1_Click()
Worksheets ("34-01") .Rows ("45:200") .Hidden = True
End Sub

That will hide the rows, but I have yet to come up with a command to toggle
hide/unhide.
Thanks
Scafidel






All times are GMT +1. The time now is 04:49 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com