LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,073
Default Hide Rows By reference to a cell


Hi SuitedAces,

I've come up with a way of having captionless buttons.

The code now relies on the buttons' names.

You will have to, however do the following with each individual
button...

1. Select one
2. Click inside the Name Box on the left side of the Formula bar
3. Type "Toggle 3" if the selected button is the one for toggling the
third row. The code as it stands relies on this being correct. If you
want to use a different name you will have to alter the code.
4. Press Enter. Be careful here, I often forget to press Enter then
the name is not changed.

Make sure you change all the button's names for the code to use ie
Toggle 6, Toggle 9

The code for this technique is ...

Public Sub Hide_Row_N()
Dim Pressed As Shape
Set Pressed = ActiveSheet.Shapes(Application.Caller)
Select Case Pressed.Name

Case "Toggle 3"
Range("MyCell").Offset(3, 0).EntireRow.Hidden = _
Not Range("MyCell").Offset(3, 0).EntireRow.Hidden

Case "Toggle 6"
Range("MyCell").Offset(6, 0).EntireRow.Hidden = _
Not Range("MyCell").Offset(6, 0).EntireRow.Hidden

Case "Toggle 9"
Range("MyCell").Offset(9, 0).EntireRow.Hidden = _
Not Range("MyCell").Offset(9, 0).EntireRow.Hidden

End Select
End Sub

Hope this makes sense

Ken Johnson



 
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
auto-hide rows, cell format (# and @), update cell refs, shade cel Mo2 Excel Discussion (Misc queries) 0 April 17th 07 03:44 AM
How to hide cell reference borders (top/left side) in Excel? jwe06 Excel Discussion (Misc queries) 1 August 3rd 06 04:41 PM
Hide Rows if cell value is mohd21uk via OfficeKB.com New Users to Excel 1 May 16th 06 03:23 PM
hide rows when the cell is #VALUE! barkiny Excel Worksheet Functions 1 March 10th 06 03:06 PM
hide rows if cell=0 Paiolas Excel Programming 2 September 8th 03 07:14 PM


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