Hide same rows on new sheet as on previous

  • Thread starter Thread starter staeri
  • Start date Start date
S

staeri

Hello!

I have two sheets in my workbook. When I activate Sheet2 I want to hide
the same rows as on Sheet1. That means for example if row 14, 17 and 21
are hidden on Sheet1 I want to hide row 14, 17 and 21 on Sheet2 when I
activate that sheet.

Can someone please help me?

Regards,

S
 
Hello!
I have two sheets in my workbook. When I activate Sheet2 I want to hide
the same rows as on Sheet1. That means for example if row 14, 17 and 21
are hidden on Sheet1 I want to hide row 14, 17 and 21 on Sheet2 when I
activate that sheet.

I don't really have tim e to test it, but it would go like this:

dim i as integer
i = 1

while (i < Sheets(1).usedrange.rows.count)

Sheets(1).Rows(i).Select
if (Selection.EntireRow.Hidden = True) then
sheets(2).rows(i).select
Selection.EntireRow.Hidden = True
end if

i = i + 1
wend



Hope it helps :)
Morris
 
Thank you!

// S

Morris skrev:
I don't really have tim e to test it, but it would go like this:

dim i as integer
i = 1

while (i < Sheets(1).usedrange.rows.count)

Sheets(1).Rows(i).Select
if (Selection.EntireRow.Hidden = True) then
sheets(2).rows(i).select
Selection.EntireRow.Hidden = True
end if

i = i + 1
wend



Hope it helps :)
Morris
 
Back
Top