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  

Macro to hide rows



 
 
Thread Tools Display Modes
  #1  
Old September 18th, 2003, 01:49 AM
Dick Stumbo
external usenet poster
 
Posts: n/a
Default Macro to hide rows

I have an excel template with 20 worksheets. I want to make
an election on the 2nd sheet in a specified cell of either
1, 2, 3, 4 or 5. With this election I want to be able to
hide specified rows on other worksheets and unhide any
previously hidden rows on the other workshhets.

I'd appreciate any ideas.
  #2  
Old September 18th, 2003, 05:12 PM
Don Guillett
external usenet poster
 
Posts: n/a
Default Macro to hide rows

Here are some ideas
Here is one I once used to hide a column, for a SHAPE. Guess it could be
shortened?

Sub HideG_UnhideG()' Assigned to a shape
If Columns("g").EntireColumn.Hidden = True Then
Columns("g").EntireColumn.Hidden = False
ActiveSheet.Shapes("toggleit").Select
Selection.Characters.Text = "HIDE G" & Chr(10) & "" & Chr(10) & ""
Range("c3").Select
Else
Columns("g").EntireColumn.Hidden = True
ActiveSheet.Shapes("Toggleit").Select
Selection.Characters.Text = "SHOW G" & Chr(10) & "" & Chr(10) & ""
End If
Range("c3").Select

'can use =not if only ONE change.....
'Columns("g").EntireColumn.Hidden = Not Columns("g").EntireColumn.Hidden
End Sub
====
more
Private Sub ToggleButton1_Click()
If ToggleButton1.Value = True Then
Sheets(3).Visible = xlVeryHidden
ToggleButton1.Caption = "Unhide Sheet3"
Else
Sheets(3).Visible = True
ToggleButton1.Caption = "Hide Sheet3"
End If
End Sub

--
HTH. Best wishes Harald



"Dick Stumbo" wrote in message
...
I have an excel template with 20 worksheets. I want to make
an election on the 2nd sheet in a specified cell of either
1, 2, 3, 4 or 5. With this election I want to be able to
hide specified rows on other worksheets and unhide any
previously hidden rows on the other workshhets.

I'd appreciate any ideas.



 




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 01:39 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.