Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default How can I unhide columns on multiple worksheets in same workbook?

Keeping in mind that I know next to nothing about coding, the following is
what appeared after using the macro recorder to unhide columns on multiple
sheets in an Excel workbook.(Same thing has occurred in Excel 97 and Excel
2002.)

Sheets(Array("Sheet1", "Sheet2", "Sheet3")).Select
Sheets("Sheet1").Activate
Columns("A:E").Select
Selection.EntireColumn.Hidden = False

After I re-hide the columns and tried to use the macro, only the columns on
the first sheet were unhidden.

Is there a shorter or more precise way to make this work on all three sheets
from a macro, without having to select each individual sheet(and will it
also work for re-hiding the columns), as below:

Sheets("Sheet1").Activate
Columns("A:E").Select
Selection.EntireColumn.Hidden = False
Sheets("Sheet2").Activate
Columns("A:E").Select
Selection.EntireColumn.Hidden = False
Sheets("Sheet3").Activate
Columns("A:E").Select
Selection.EntireColumn.Hidden = False

Any help greatfully accepted.
--
Carey in MA


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default How can I unhide columns on multiple worksheets in same workbook?

Sheets("Sheet1").Columns("A:E").EntireColumn.Hidde n = False
Sheets("Sheet2").Columns("A:E").EntireColumn.Hidde n = False
Sheets("Sheet3").Columns("A:E").EntireColumn.Hidde n = False
--
HTH...

Jim Thomlinson


"Carey N." wrote:

Keeping in mind that I know next to nothing about coding, the following is
what appeared after using the macro recorder to unhide columns on multiple
sheets in an Excel workbook.(Same thing has occurred in Excel 97 and Excel
2002.)

Sheets(Array("Sheet1", "Sheet2", "Sheet3")).Select
Sheets("Sheet1").Activate
Columns("A:E").Select
Selection.EntireColumn.Hidden = False

After I re-hide the columns and tried to use the macro, only the columns on
the first sheet were unhidden.

Is there a shorter or more precise way to make this work on all three sheets
from a macro, without having to select each individual sheet(and will it
also work for re-hiding the columns), as below:

Sheets("Sheet1").Activate
Columns("A:E").Select
Selection.EntireColumn.Hidden = False
Sheets("Sheet2").Activate
Columns("A:E").Select
Selection.EntireColumn.Hidden = False
Sheets("Sheet3").Activate
Columns("A:E").Select
Selection.EntireColumn.Hidden = False

Any help greatfully accepted.
--
Carey in MA



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default How can I unhide columns on multiple worksheets in same workbook?

Jim, many thanks for your response. I shall try that. It certainly looks
much neater than what I was going to use.
--
Regards,
Carey in MA


"Jim Thomlinson" wrote in message
...
Sheets("Sheet1").Columns("A:E").EntireColumn.Hidde n = False
Sheets("Sheet2").Columns("A:E").EntireColumn.Hidde n = False
Sheets("Sheet3").Columns("A:E").EntireColumn.Hidde n = False
--
HTH...

Jim Thomlinson


"Carey N." wrote:

Keeping in mind that I know next to nothing about coding, the following

is
what appeared after using the macro recorder to unhide columns on

multiple
sheets in an Excel workbook.(Same thing has occurred in Excel 97 and

Excel
2002.)

Sheets(Array("Sheet1", "Sheet2", "Sheet3")).Select
Sheets("Sheet1").Activate
Columns("A:E").Select
Selection.EntireColumn.Hidden = False

After I re-hide the columns and tried to use the macro, only the columns

on
the first sheet were unhidden.

Is there a shorter or more precise way to make this work on all three

sheets
from a macro, without having to select each individual sheet(and will it
also work for re-hiding the columns), as below:

Sheets("Sheet1").Activate
Columns("A:E").Select
Selection.EntireColumn.Hidden = False
Sheets("Sheet2").Activate
Columns("A:E").Select
Selection.EntireColumn.Hidden = False
Sheets("Sheet3").Activate
Columns("A:E").Select
Selection.EntireColumn.Hidden = False

Any help greatfully accepted.
--
Carey in MA





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default How can I unhide columns on multiple worksheets in same workbook?

Carey,
If you want a more flexible way:

Dim WS As Worksheet
Const SheetsToWorkOn As String = "Sheet2,Sheet3"

'For Each WS In Worksheets(Array("Sheet2", "Sheet3"))
'Or
For Each WS In Worksheets(Split(SheetsToWorkOn, ","))
WS.Columns("A:E").EntireColumn.Hidden = False
Next

NickHK

"Carey N." wrote in message
news:n_qEg.20498$yE1.5567@trndny02...
Keeping in mind that I know next to nothing about coding, the following is
what appeared after using the macro recorder to unhide columns on multiple
sheets in an Excel workbook.(Same thing has occurred in Excel 97 and Excel
2002.)

Sheets(Array("Sheet1", "Sheet2", "Sheet3")).Select
Sheets("Sheet1").Activate
Columns("A:E").Select
Selection.EntireColumn.Hidden = False

After I re-hide the columns and tried to use the macro, only the columns

on
the first sheet were unhidden.

Is there a shorter or more precise way to make this work on all three

sheets
from a macro, without having to select each individual sheet(and will it
also work for re-hiding the columns), as below:

Sheets("Sheet1").Activate
Columns("A:E").Select
Selection.EntireColumn.Hidden = False
Sheets("Sheet2").Activate
Columns("A:E").Select
Selection.EntireColumn.Hidden = False
Sheets("Sheet3").Activate
Columns("A:E").Select
Selection.EntireColumn.Hidden = False

Any help greatfully accepted.
--
Carey in MA




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
Unhide multiple worksheets in workbook Maureen D. Excel Discussion (Misc queries) 2 January 27th 10 07:50 PM
Does sharing a workbook cause columns/rows to unhide? Purrplegrrl77 Excel Discussion (Misc queries) 1 October 21st 09 02:04 PM
Unhide Multiple Worksheets At Once Val Steed Excel Discussion (Misc queries) 5 August 24th 09 11:17 PM
How do I unhide several worksheets within a workbook? jggsfl Excel Discussion (Misc queries) 1 July 11th 06 07:44 PM
adjusting columns in multiple worksheets of workbook with one step carole Excel Discussion (Misc queries) 2 July 8th 06 03:07 AM


All times are GMT +1. The time now is 11:09 AM.

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

About Us

"It's about Microsoft Excel"