ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   hide multiple rows (https://www.excelbanter.com/excel-programming/389033-hide-multiple-rows.html)

amit

hide multiple rows
 
I would like to unhide a few rows based on some condition. Out of these rows,
two rows are hidden using some other condition.

I tried the following:
Worksheets(1).Rows("41:44", "47:51").Hidden = False
(Rows 45 & 46 are to remain hidden)

But this is not working. Please help.


cory

hide multiple rows
 
Try this:
Worksheets(1).Range("41:44, 47:51").EntireRow.Hidden = False


"Amit" wrote:

I would like to unhide a few rows based on some condition. Out of these rows,
two rows are hidden using some other condition.

I tried the following:
Worksheets(1).Rows("41:44", "47:51").Hidden = False
(Rows 45 & 46 are to remain hidden)

But this is not working. Please help.


Vergel Adriano

hide multiple rows
 
Amit,

try it this way:

With Worksheets(1)
Union(.Range("41:44"), .Range("47:51")).Rows.Hidden = False
End With



--
Hope that helps.

Vergel Adriano


"Amit" wrote:

I would like to unhide a few rows based on some condition. Out of these rows,
two rows are hidden using some other condition.

I tried the following:
Worksheets(1).Rows("41:44", "47:51").Hidden = False
(Rows 45 & 46 are to remain hidden)

But this is not working. Please help.


amit

hide multiple rows
 
Dear Cory & Vergel

Thanks to both of you. It worked both ways.




"Amit" wrote:

I would like to unhide a few rows based on some condition. Out of these rows,
two rows are hidden using some other condition.

I tried the following:
Worksheets(1).Rows("41:44", "47:51").Hidden = False
(Rows 45 & 46 are to remain hidden)

But this is not working. Please help.



All times are GMT +1. The time now is 05:27 PM.

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