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!
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
Try

Code:
Sub testb()
Dim ws As Worksheet
For Each ws In Sheets(Array("AUG", "SEP", "OCT", "Q1", "NOV", "DEC", "JAN", "Q2", "FALL", "FALL2"))
    ws.Range("A32:A59,A249:A281,A435").EntireRow.Hidden = False
Next ws
End Sub
 
Upvote 0
I think the problem is trying to unhide multiple noncontiguous rows in one shot. Try this:
Code:
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("next group here").EntireRow.Hidden = False
    ws.Rows("next group here").EntireRow.Hidden = False

Next ws
 
Upvote 0
Worked for me too.

Possiblities:

1. You didn't have any rows hidden before running the code, so it appeared as not to work.

2. You do not have the exact Array of sheets (all 9 and spelled exact) as is what is in the Array code line. In which case you would get an Subscript out of range Error.
 
Upvote 0
I think the problem is trying to unhide multiple noncontiguous rows in one shot. Try this:


I just tested with Eight groups and 3 single rows. Worked just fine the way Peter had it written.

Which brings us back to post # 17
 
Upvote 0
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.
 
Upvote 0
Worked for me too.

Possiblities:

1. You didn't have any rows hidden before running the code, so it appeared as not to work.

2. You do not have the exact Array of sheets (all 9 and spelled exact) as is what is in the Array code line. In which case you would get an Subscript out of range Error.


1. The rows are hidden before running the code. I check each time to make sure.

2. The array of sheets are named exactly as was shown.
 
Upvote 0

Forum statistics

Threads
1,215,020
Messages
6,122,709
Members
449,093
Latest member
Mnur

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