View Single Post
  #14   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default hide or unhide rows with button

Maybe...

You can hide rows if you use Data|Subtotals, or Data|Outlining or even
Data|Filter|autofilter.

But it really depends...

Johan wrote:

Hi

I searched and found also this post helpful. I have an additional question
in this matter.

Is it possible to hide and unhide the rows smoothly as in a Powerpoint?

/Johan

"Bea" skrev:

This was perfect Dave! Thank you so much!

"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