Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default hide or unhide rows with button

You can hide entire rows or entire columns.

Or you can hide (kind of) a range by giving the a nice format--same color font
as the fill color (white on white???).

Or by using a custom number format:
;;;
(three semicolons)

If you need a macro, you could record one when you do it manually.

Mike wrote:

Is there a way to link the contents of a cell to this macro? For example, I
don't want to have a button, but I want to click the main category text/cell
to either hide or unhide the range specified... Is this possible?

"Dave Peterson" wrote:

You could put a button from the control toolbox toolbar on that worksheet.
Double click on that button and you'll see where the code goes.

Paste this in that window and end up with something that looks like this.

Option Explicit
Private Sub CommandButton1_Click()
Dim myRng As Range

Set myRng = Me.Range("a3:a5,a7:a19,a22:a33")

myRng.EntireRow.Hidden = Not (myRng(1).EntireRow.Hidden)

End Sub

Adjust the range you want to hide/show

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm


Bea wrote:

I want to group rows together and have a quick expand/collapse button on the
sheet itself. I see the group/outline function but do not like the display of
the expand/collapse in the left side of the rows.


--

Dave Peterson


--

Dave Peterson
Reply
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
hide column and rows m_john Excel Discussion (Misc queries) 2 November 4th 05 04:13 PM
hide a button Natalie Excel Worksheet Functions 1 March 14th 05 02:29 PM
How do you use the explode and collapse panel to hide rows? EMG03 Excel Worksheet Functions 2 December 21st 04 12:40 AM
Checkbox to hide and unhide rows Please. Steved Excel Worksheet Functions 2 December 6th 04 11:30 PM
Why cannot I unhide the hidden rows ? Jim Edwards Excel Discussion (Misc queries) 2 December 4th 04 04:38 PM


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