Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default 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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Hiding rows when opening workbook

Thanks, but

the problem is still there. Rows 41:47 and 51:54 hids from sheet1.


Mardo

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Collapse grouped rows and columns on opening workbook Scott Excel Discussion (Misc queries) 4 August 6th 08 10:40 PM
Hiding a button when hiding rows fergusor Excel Discussion (Misc queries) 2 August 10th 06 02:31 PM
Hiding workbooks on opening Andy Excel Programming 2 June 10th 04 12:23 PM
Shared Workbook - Hiding rows as per Username gr8guy Excel Programming 0 June 9th 04 09:03 AM
Shared Workbook - Hiding rows as per Username gr8guy Excel Programming 0 June 8th 04 05:36 AM


All times are GMT +1. The time now is 10:40 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"