Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Show / Hide Columns in multiple sheets


Hi all.

I am having a slight problem hiding and showing columns across multiple
workbooks. I have created an array that selects multiple sheets and
selects the required columns to hide. When I then try and hide them it
only hides the columns on the visible sheet. I could manually select
each and every sheet in the workbook and run it that way but it seems
very inefficient when they are already selected. Does anyone know of a
way around this problem?

I am using Excel 2000 and this is basically the code I am using:

Code:
--------------------

Sub MonthFormatter()

Dim strCurrMnth

strCurrMnth = Range("A1").Value

Sheets(Array("Consolidated", "Fees Billed", "Other Income", "Bad Debt & Disbs WO", _
"Partner Charges", "Fee Earner Related Costs", "Support Charges", "Travel", _
"Fee Earner Payroll", "Support Associated Costs", "Partner Costs", "Training", _
"Marketing", "Other Costs")).Select
Columns("D:S").Select
Selection.EntireColumn.Hidden = False
Select Case strCurrMnth
Case "Show All"
Columns("D:S").Select
Selection.EntireColumn.Hidden = False
Range("B1").Select
Case "May"
Columns("G:S").Select
Selection.EntireColumn.Hidden = True
Range("B1").Select
Case "June"
Columns("G:S").Select
Selection.EntireColumn.Hidden = True
Range("B1").Select
End Select
Sheets("Consolidated").Select
Range("B1").Select

End Sub

--------------------


--
Shadster
------------------------------------------------------------------------
Shadster's Profile: http://www.excelforum.com/member.php...o&userid=24610
View this thread: http://www.excelforum.com/showthread...hreadid=381964

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Show / Hide Columns in multiple sheets


Try something like

Sheets("Consolidated").Activate
Columns("D:S").Select
Selection.EntireRow.Hidden = False

Sheets("Fees Billed").Activate
Columns("G:S").Select
Selection.EntireRow.Hidden = False

Sheets("Other Income").Activate
Columns("G:S").Select
Selection.EntireRow.Hidden = False

and so on...


Oz


--
ozcank


------------------------------------------------------------------------
ozcank's Profile: http://www.excelforum.com/member.php...fo&userid=5328
View this thread: http://www.excelforum.com/showthread...hreadid=381964

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Show / Hide Columns in multiple sheets


Cheers Oz

That will work but seems very inefficient when all the sheets are
already selected. If I manually select hide columns with multiple
sheets selected it hides them on all the sheets.

If I then record that same action and play it back it only does the
active sheet. I have approximately 20 workbooks each with different
sheet names that this code has to be applied to so activating each
sheet and then executing the code will be a very time consuming process
to code and to execute.

Surely their is a way to execute the code on all the sheets highlighted
without having to activate each sheet in turn??

Shad


--
Shadster
------------------------------------------------------------------------
Shadster's Profile: http://www.excelforum.com/member.php...o&userid=24610
View this thread: http://www.excelforum.com/showthread...hreadid=381964

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
Is there a quick way to show selected columns (not using hide) Anhlyss Excel Discussion (Misc queries) 1 February 18th 10 07:52 PM
how can hide and show columns using macro? Hoshyar Excel Worksheet Functions 4 September 2nd 05 03:45 PM
Show/Hide Columns StephanieH Excel Programming 8 June 24th 05 02:16 PM
Hide/show sheets by first part of sheet name Brentus Excel Programming 2 September 15th 04 06:21 AM
Show Form, Hide all Sheets John Pierce Excel Programming 2 June 10th 04 10:42 AM


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