Unhiding rows across worksheets at once

nmdks3

New Member
Joined
Feb 22, 2008
Messages
11
I am trying to unhide a range of rows across several worksheets in the same book at once. Here is the code I have:

Sheets(Array("AUG", "SEP", "OCT", "Q1", "NOV", "DEC", "JAN", "Q2", "FALL", "FALL2")).Select
Sheets("AUG").Activate

' Show regular departments
Range("9:30,222:247").Select
Range("A9").Activate
Selection.EntireRow.Hidden = False

Currently, it is only unhiding the rows on the "AUG" tab. Any suggestions? All help is appreciated!
 
Peter's sub using Range("list multiple A ranges here").entirerow.hidden
works for me, but I can't use Rows("list multiple rows here") with multiple, noncontiguous rows. The latter generates a type mismatch error.


No , sorry, it doesn't work and I apologise. Using range.entirerow does work (tested and tested again).
 
Upvote 0

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
That code errors out with a Type Mismatch...


Dim ws As Worksheet
For Each ws In Sheets(Array("AUG", "SEP", "OCT", "Q1", "NOV", "DEC", "JAN", "Q2", "FALL", "FALL2"))
ws.Rows("32:59,249:281,435:435").Hidden = False
Next ws




</PRE>

Above is taken from the last time we saw your code. I assume that you did fix the EntireRow.Hidden part and the ws.Rows part

What do you have above the
Dim ws As Worksheet statement.

For that matter, maybe your whole code would help. There seems to be something else going on.
 
Last edited:
Upvote 0
Here is the entire code. Note that the section that highlights the ranges works fine across all of the worksheets in the range. For some reason, the unhide rows doesn't.

-----------------------------------------
Sub Show_DMM06()
'
' Show_DMM06 Macro
' Macro written 9/15/2008 by Darren Schmits x3274
' This macro unhides all of the departments for DMM06

' Updated 08/05/2010
'

Dim ws As Worksheet
For Each ws In Sheets(Array("AUG", "SEP", "OCT", "Q1", "NOV", "DEC", "JAN", "Q2", "FALL", "FALL2"))
ws.Rows("32:59").EntireRow.Hidden = False
ws.Rows("249:281").EntireRow.Hidden = False
ws.Rows("435:435").EntireRow.Hidden = False
Next ws

' Highlight buyers

Sheets(Array("AUG", "SEP", "OCT", "Q1", "NOV", "DEC", "JAN", "Q2", "FALL")).Select
Range("B9:AX9,B12:AX12,B18:AX18,B21:AX21,B28:AX28,B222:AX222,B226:AX226,B233:AX233,B237:AX237,B245:AX245").Select
With Selection.Interior
.ColorIndex = 6
.Pattern = xlSolid
End With
Sheets(Array("FALL2")).Select
Range("B9:AK9,B12:AK12,B18:AK18,B21:AK21,B28:AK28,B222:AK222,B226:AK226,B233:AK233,B237:AK237,B245:AK245").Select
With Selection.Interior
.ColorIndex = 6
.Pattern = xlSolid
End With

Range("D7").Select


End Sub


-----------------------------------------

I appreciate everyone's help with this!
Darren
 
Upvote 0
Ahh, I think I see where the confusion is.

The code that works is Peter's in post # 12.

That is the one you should be using. That is the one I was using to do my tests.
 
Last edited:
Upvote 0
There it is


Code:
ws.Rows("32:59").EntireRow.Hidden = False
ws.Rows("249:281").EntireRow.Hidden = False
ws.Rows("435:435").EntireRow.Hidden = False

should be ws.Range and then you can group the rows.

See Peter's post # 12 above.
 
Upvote 0

Forum statistics

Threads
1,216,372
Messages
6,130,223
Members
449,567
Latest member
ashsweety

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top