LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,565
Default Macro for hiding/unhiding a set of rows

If I read your post correctly, you wanted to use a command button to run the
macro that gets the next twenty rows. Create a CommandButton1, or change
the name in the code, and try this:

Private Sub CommandButton1_Click()
Set srcRng = Range("A12:A211") 'Define the range
r = 12 'enumerate beginning row
'Find the last visible row in the range
s = srcRng.SpecialCells(xlCellTypeVisible).Count
'Get the next 20 rows
Range("A" & s + r).Resize(20, 1).EntireRow.Hidden = False
End Sub



"GoBucks" wrote in message
...
Thank you! I will give these a try.

"ND Pard" wrote:

Sub Macro_for_Obect_1()

Dim i As Integer
i = 32

Do While i <= 212
If Rows(i).EntireRow.Hidden = True Then
Range(Rows(i), Rows(i + 19)).EntireRow.Hidden = False
Exit Sub
End If
i = i + 20
Loop

End Sub

Sub Macro_for_Object_2()
Range("A32:A211").EntireRow.Hidden = False
End Sub

Sub Macro_for_Object_3()
Range("A32:A211").EntireRow.Hidden = True
End Sub

Good Luck



 
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
hiding/unhiding rows Art Excel Worksheet Functions 1 March 16th 10 05:00 PM
hidden rows but not from hiding/unhiding? Reeder88 Excel Discussion (Misc queries) 1 March 12th 08 06:14 PM
unhiding and hiding rows Paul_of_Abingdon[_2_] Excel Discussion (Misc queries) 2 March 6th 08 03:22 PM
Hiding/unhiding rows Matheus Excel Discussion (Misc queries) 2 November 11th 07 11:20 PM
Hiding/Unhiding rows Arne Hegefors Excel Programming 2 July 21st 06 08:19 AM


All times are GMT +1. The time now is 12:38 PM.

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"