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

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
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.Rows("9:30,222:247").Hidden = False
Next ws
End Sub
 
Upvote 0
Edit this line

Range("9:30,222:247").EntireRow.Hidden = False
 
Upvote 0
What did you end up with?

This line in your orginal code;
Code:
Sheets("AUG").Activate
was ungrouping your sheets if Sheets AUG was not the active sheet when you ran your code.

That is why you were experienceing the code working on only that sheet.
 
Upvote 0
I used Fowmy's suggestion, and it worked once. Now that I am testing it in other sections, it's not working again.
 
Upvote 0
Here's what I have now...


Sheets(Array("AUG", "SEP", "OCT", "Q1", "NOV", "DEC", "JAN", "Q2", "FALL", "FALL2")).Select
Range("32:59,249:281,435:435").EntireRow.Hidden = False
 
Upvote 0
At the risk of repetition

Code:
Sub testb()
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
End Sub
 
Upvote 0
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>
 
Upvote 0
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
I think Peter dropped a property:
Rich (BB code):
ws.Rows("32:59,249:281,435:435").EntireRow.Hidden = False
 
Upvote 0

Forum statistics

Threads
1,214,979
Messages
6,122,550
Members
449,088
Latest member
davidcom

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