![]() |
Hidden Column in VBA
Selecting 'Group Sheet' and hide column using VBA.
Sheets(Array("sheet1", "sheet2", "sheet3")).Select Sheets("sheet1").Activate Range("A:A,D:F,J:J,N:O").Select Selection.EntireColumn.Hidden = True The result was only "Sheet1" can hide the column, the other cannot. Any ideas? Norika --- Message posted from http://www.ExcelForum.com/ |
Hidden Column in VBA
I don't know about the one line solution, but here's one way:
Sub test() Dim wks As Worksheet For Each wks In Sheets(Array("Sheet1", "Sheet2")) wks.Range("A:A").EntireColumn.Hidden = True Next End Sub -- Rob van Gelder - http://www.vangelder.co.nz/excel "norika " wrote in message ... Selecting 'Group Sheet' and hide column using VBA. Sheets(Array("sheet1", "sheet2", "sheet3")).Select Sheets("sheet1").Activate Range("A:A,D:F,J:J,N:O").Select Selection.EntireColumn.Hidden = True The result was only "Sheet1" can hide the column, the other cannot. Any ideas? Norika --- Message posted from http://www.ExcelForum.com/ |
Hidden Column in VBA
|
Hidden Column in VBA
hi
From book by Green et al "...However, only the active sheet is affected when you apply changes to a grouped sheet using VBA code...you need to set up a for...each...next loop to carry out changes on each member." regards Paul norika wrote in message ... Selecting 'Group Sheet' and hide column using VBA. Sheets(Array("sheet1", "sheet2", "sheet3")).Select Sheets("sheet1").Activate Range("A:A,D:F,J:J,N:O").Select Selection.EntireColumn.Hidden = True The result was only "Sheet1" can hide the column, the other cannot. Any ideas? Norika --- Message posted from http://www.ExcelForum.com/ |
Hidden Column in VBA
How do I change the command line and let me go to cell A1?
I try to change from wks.Range("A:A").EntireColumn.Hidden = True to wks.Range("A1").Select Of course, it failed. Norika --- Message posted from http://www.ExcelForum.com/ |
All times are GMT +1. The time now is 04:18 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com