VBA Unhiding blank rows across a number of ranges

scoha

Active Member
Joined
Jun 15, 2005
Messages
428
Part of my code is set to unhide a group of ranges (so that I can then paste to these ranges from another subsquent part) and I have tried to do it this way:
Code:
            'Unhides blank rows
             Set Rng = Range("$C$9:$C$95", Nothing)
    
               For Each Area In Rng.Areas
                 For Each Cell In Area
                   Cell.EntireRow.Hidden = False
                 Next Cell
               Next Area
               
             Set Rng = Range(Sheets("WI").Range("WI451Names"), Sheets("Bits").Range("Bits451Names"), Sheets("PPE").Range("PPE451Names"))
    
               For Each Area In Rng.Areas
                 For Each Cell In Area
                   Cell.EntireRow.Hidden = False
                 Next Cell
               Next Area

But I get a "wrong" number of arguments error - though it works with unnamed ranges as first part.

Can I modify this to work with a group of named ranges - just so my coding keeps trim?
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
you can give this a spin

Code:
nms = Array("Bits451Names", "PPE451Names", "WI451Names")  'do select ranges
For r = 0 To UBound(nms)
    Range(nms(r)).Rows.EntireRow.Hidden = False
Next
 
Upvote 0
This didnt seem to work - would I have to define the named ranges across different sheets? Each of the named ranges is located on different sheets?
 
Upvote 0
I'm thinking the issue is more with the scope of the named ranges being WorkSheet, so we can qualify the name and it should now function regardless of the scope of the named range.

Code:
nms = Array("[COLOR=blue]Bits![/COLOR]Bits451Names", "[COLOR=blue]PPE![/COLOR]PPE451Names", "[COLOR=blue]WI![/COLOR]WI451Names")  'do select ranges
For r = 0 To UBound(nms)
    Range(nms(r)).Rows.EntireRow.Hidden = False
Next
 
Upvote 0

Forum statistics

Threads
1,224,613
Messages
6,179,896
Members
452,948
Latest member
Dupuhini

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