ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Hid rows in a hidden sheet. (https://www.excelbanter.com/excel-discussion-misc-queries/27909-hid-rows-hidden-sheet.html)

Ben

Hid rows in a hidden sheet.
 
Hi,
I would like to hide few rows in range name created in a hidded sheet.
I'm using this code:
Sheets("ABC").Range("XYZ").Range(Cells(1, 1), Cells(5, 1)).EntireRow.Hidden
= False
This code work until the sheet ABC is Visible and Active.
Is there a way to hide rows on a hidden sheet. I don't want to use:
Sheets("ABC").Range("A1":"A5").EntireRow.Hidden = False
Any help will be appreciated.
Thank you.

Dave Peterson

you have some references to unqualified ranges (cells(1,1) and cells(5,1) refer
to the activesheet.

You could use something like:

with sheets("abc").range("xyz")
.range(.cells(1,1),.cells(5,1)).entirerow.hidden = false
end with

Those dots mean that the range belongs to the previous With object.


Ben wrote:

Hi,
I would like to hide few rows in range name created in a hidded sheet.
I'm using this code:
Sheets("ABC").Range("XYZ").Range(Cells(1, 1), Cells(5, 1)).EntireRow.Hidden
= False
This code work until the sheet ABC is Visible and Active.
Is there a way to hide rows on a hidden sheet. I don't want to use:
Sheets("ABC").Range("A1":"A5").EntireRow.Hidden = False
Any help will be appreciated.
Thank you.


--

Dave Peterson

Ben

Thank you Dave.
I added the "." and now it is working fine.
Thank you again.

"Dave Peterson" wrote:

you have some references to unqualified ranges (cells(1,1) and cells(5,1) refer
to the activesheet.

You could use something like:

with sheets("abc").range("xyz")
.range(.cells(1,1),.cells(5,1)).entirerow.hidden = false
end with

Those dots mean that the range belongs to the previous With object.


Ben wrote:

Hi,
I would like to hide few rows in range name created in a hidded sheet.
I'm using this code:
Sheets("ABC").Range("XYZ").Range(Cells(1, 1), Cells(5, 1)).EntireRow.Hidden
= False
This code work until the sheet ABC is Visible and Active.
Is there a way to hide rows on a hidden sheet. I don't want to use:
Sheets("ABC").Range("A1":"A5").EntireRow.Hidden = False
Any help will be appreciated.
Thank you.


--

Dave Peterson



All times are GMT +1. The time now is 08:26 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com