Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Is there a quick way to show selected columns (not using hide) | Excel Discussion (Misc queries) | |||
how can hide and show columns using macro? | Excel Worksheet Functions | |||
Show/Hide Columns | Excel Programming | |||
Hide/show sheets by first part of sheet name | Excel Programming | |||
Show Form, Hide all Sheets | Excel Programming |