Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Hiding rows when opening workbook
Hi,
I'm trying to hide two sets of rows when the workbook opens. Rows are in sheet 3, and those rows hides when the workbook opens. My problem is that also same rows ( 41:47 and 51:54) hides in sheet 1. Some cells in those rows in sheet 3 are linked to sheet 1. I'm using this code placed in ThisWorkBook: Sub Workbook_Open() Worksheets(3).Activate ActiveSheet.Rows("41:47").Select Selection.EntireRow.Hidden = True Worksheets(3).Activate ActiveSheet.Rows("51:54").Select Selection.EntireRow.Hidden = True End Sub So, what am I doing wrong here? Regards, Mardo |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Hiding rows when opening workbook
try this
Sub Workbook_Open() Worksheets(3).RANGE("41:47,51:54").EntireRow.Hidde n = True End Sub -- Don Guillett SalesAid Software wrote in message oups.com... Hi, I'm trying to hide two sets of rows when the workbook opens. Rows are in sheet 3, and those rows hides when the workbook opens. My problem is that also same rows ( 41:47 and 51:54) hides in sheet 1. Some cells in those rows in sheet 3 are linked to sheet 1. I'm using this code placed in ThisWorkBook: Sub Workbook_Open() Worksheets(3).Activate ActiveSheet.Rows("41:47").Select Selection.EntireRow.Hidden = True Worksheets(3).Activate ActiveSheet.Rows("51:54").Select Selection.EntireRow.Hidden = True End Sub So, what am I doing wrong here? Regards, Mardo |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Hiding rows when opening workbook
Thanks, but
the problem is still there. Rows 41:47 and 51:54 hids from sheet1. Mardo |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Hiding rows when opening workbook
Don gave you a solution I would expect to work. As to the cause, I would
suspect that you have sheets 1 and 3 both selected (you should see [group] in the caption bar at the top of the workbook if you are windowed - or at the top of the excel window if maximized). Using your existing code, you could change Worksheets(3).Activate to Worksheets(3).Select if that is the problem. This will ungroup the sheets. Unless there is a reason to group the sheets, I would ungroup them. -- Regards, Tom Ogilvy " wrote: Hi, I'm trying to hide two sets of rows when the workbook opens. Rows are in sheet 3, and those rows hides when the workbook opens. My problem is that also same rows ( 41:47 and 51:54) hides in sheet 1. Some cells in those rows in sheet 3 are linked to sheet 1. I'm using this code placed in ThisWorkBook: Sub Workbook_Open() Worksheets(3).Activate ActiveSheet.Rows("41:47").Select Selection.EntireRow.Hidden = True Worksheets(3).Activate ActiveSheet.Rows("51:54").Select Selection.EntireRow.Hidden = True End Sub So, what am I doing wrong here? Regards, Mardo |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Collapse grouped rows and columns on opening workbook | Excel Discussion (Misc queries) | |||
Hiding a button when hiding rows | Excel Discussion (Misc queries) | |||
Hiding workbooks on opening | Excel Programming | |||
Shared Workbook - Hiding rows as per Username | Excel Programming | |||
Shared Workbook - Hiding rows as per Username | Excel Programming |