Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 577
Default Collapse grouped rows and columns on opening workbook

Hi, I have a large share workbook of some 22 sheets. Every sheet has a couple
of sections of grouped rows and columns. I am looking for way to ensure that
when ever a user opens the workbook, either directly or on sharepoint, that
the grouped rows and columns are €˜collapsed.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 63
Default Collapse grouped rows and columns on opening workbook

Press Alt+F11 to bring up the VBA editor and click on ThisWorkbook in the
Project pane. Select Workbook from the drop-down list at the top of the
editor window and Open from the right-hand list and you will see the Private
Sub Workbook_Open() procedure appear. Add the following code:

Private Sub Workbook_Open()
Worksheets("Sheet1").Outline.ShowLevels 1
End Sub

(you can add more lines for other sheets containing outlines).

Andrea Jones
www.stratatraining.co.uk

"Scott" wrote:

Hi, I have a large share workbook of some 22 sheets. Every sheet has a couple
of sections of grouped rows and columns. I am looking for way to ensure that
when ever a user opens the workbook, either directly or on sharepoint, that
the grouped rows and columns are €˜collapsed.

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 577
Default Collapse grouped rows and columns on opening workbook

Hi thanks for the reply. I should have mentioned that the worksheets have
variable names, depending on the input in range A10:A30 on the main sheet
called "Cover Page". Also working in Excel 2003 in case it makes a difference.

"Andrea Jones" wrote:

Press Alt+F11 to bring up the VBA editor and click on ThisWorkbook in the
Project pane. Select Workbook from the drop-down list at the top of the
editor window and Open from the right-hand list and you will see the Private
Sub Workbook_Open() procedure appear. Add the following code:

Private Sub Workbook_Open()
Worksheets("Sheet1").Outline.ShowLevels 1
End Sub

(you can add more lines for other sheets containing outlines).

Andrea Jones
www.stratatraining.co.uk

"Scott" wrote:

Hi, I have a large share workbook of some 22 sheets. Every sheet has a couple
of sections of grouped rows and columns. I am looking for way to ensure that
when ever a user opens the workbook, either directly or on sharepoint, that
the grouped rows and columns are €˜collapsed.

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 63
Default Collapse grouped rows and columns on opening workbook

OK, use this:

Private Sub Workbook_Open()
Dim sname as string
For Each ws in Worksheets
sname=ws.name
ActiveWorkbook.Worksheets(sname).Outline.Showlevel s 1
Next ws
End Sub

Andrea Jones
www.stratatraining.co.uk

"Scott" wrote:

Hi thanks for the reply. I should have mentioned that the worksheets have
variable names, depending on the input in range A10:A30 on the main sheet
called "Cover Page". Also working in Excel 2003 in case it makes a difference.

"Andrea Jones" wrote:

Press Alt+F11 to bring up the VBA editor and click on ThisWorkbook in the
Project pane. Select Workbook from the drop-down list at the top of the
editor window and Open from the right-hand list and you will see the Private
Sub Workbook_Open() procedure appear. Add the following code:

Private Sub Workbook_Open()
Worksheets("Sheet1").Outline.ShowLevels 1
End Sub

(you can add more lines for other sheets containing outlines).

Andrea Jones
www.stratatraining.co.uk

"Scott" wrote:

Hi, I have a large share workbook of some 22 sheets. Every sheet has a couple
of sections of grouped rows and columns. I am looking for way to ensure that
when ever a user opens the workbook, either directly or on sharepoint, that
the grouped rows and columns are €˜collapsed.

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 577
Default Collapse grouped rows and columns on opening workbook

Andrea,

Thanks for the code. I needed to mod it slightly to work, added parameter
for rows and columns level 1 at the end of the show level object. Otherwise
it only collapsed the rows? Thanks again

Scott

"Andrea Jones" wrote:

OK, use this:

Private Sub Workbook_Open()
Dim sname as string
For Each ws in Worksheets
sname=ws.name
ActiveWorkbook.Worksheets(sname).Outline.Showlevel s 1
Next ws
End Sub

Andrea Jones
www.stratatraining.co.uk

"Scott" wrote:

Hi thanks for the reply. I should have mentioned that the worksheets have
variable names, depending on the input in range A10:A30 on the main sheet
called "Cover Page". Also working in Excel 2003 in case it makes a difference.

"Andrea Jones" wrote:

Press Alt+F11 to bring up the VBA editor and click on ThisWorkbook in the
Project pane. Select Workbook from the drop-down list at the top of the
editor window and Open from the right-hand list and you will see the Private
Sub Workbook_Open() procedure appear. Add the following code:

Private Sub Workbook_Open()
Worksheets("Sheet1").Outline.ShowLevels 1
End Sub

(you can add more lines for other sheets containing outlines).

Andrea Jones
www.stratatraining.co.uk

"Scott" wrote:

Hi, I have a large share workbook of some 22 sheets. Every sheet has a couple
of sections of grouped rows and columns. I am looking for way to ensure that
when ever a user opens the workbook, either directly or on sharepoint, that
the grouped rows and columns are €˜collapsed.

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
Expand/Collapse Grouped Data in Protected Worksheet Robert Slattery Excel Discussion (Misc queries) 8 November 24th 15 05:08 PM
Shortcut for hide/show detail in grouped columns/rows Corey Excel Discussion (Misc queries) 1 November 20th 07 12:06 AM
How do I move the expand/collapse for rows and columns in Excel? JP Excel Worksheet Functions 0 May 4th 07 02:40 AM
Grouped columns & rows WBKLAK Excel Worksheet Functions 2 September 27th 06 07:06 PM
Grouped Columns/Rows bayhe Excel Worksheet Functions 2 December 15th 04 12:05 PM


All times are GMT +1. The time now is 08:15 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"