LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Hide and Unhide Rows button

I have this code for a button to hide and Unhide rows (7 to 10) But it
hides everything in my sheet. I just want it to hide just the 4 rows.

Private Sub CommandButton8_Click()
If CommandButton8.Caption = "Hide" Then
Range("7:7,8:8,9:9,10:10").Select
Selection.EntireRow.Hidden = True
CommandButton8.Caption = "UnHide"
Else
Range("7:7,8:8,9:9,10:10").Select
Selection.EntireRow.Hidden = False
CommandButton8.Caption = "Hide"
End If
End Sub

Thanks in advance,

Cheers John
 
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
Enabling option „Format rows“ to hide/unhide rows using VBA-code? ran58 Excel Discussion (Misc queries) 0 July 28th 09 03:46 PM
hide or unhide rows with button Bea Excel Discussion (Misc queries) 15 September 19th 07 07:03 PM
Code for button to hide/unhide rows Chris Excel Worksheet Functions 5 March 5th 07 06:15 AM
Command Button to Hide/Unhide Rows Bea Excel Discussion (Misc queries) 4 March 16th 06 03:21 PM
create button that can hide/unhide sheets and hyperlink... Helen Excel Programming 7 November 16th 05 04:03 AM


All times are GMT +1. The time now is 06:27 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"