Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Code not hiding columns
I recorded the following code that should hide Col. F in
Sheets 1, 2, and 3. This works fine when I record, but when I run the code manually Col. F hides on Sheet 1 only, while the column is merely selected on Sheets 2 & 3. Any idea what happens here? Thanks in advance! Sheets(Array("Sheet1", "Sheet2", "Sheet3")).Select Columns("F:F").Select Selection.EntireColumn.Hidden = True Sheets("Sheet1").Select End Sub |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Code not hiding columns
try
Sub hidecolf() For Each ws In Sheets(Array("Sheet1", "Sheet2", "Sheet3")) ws.Columns("F:F").EntireColumn.Hidden = True Next ws End Sub -- Don Guillett SalesAid Software "Eva Shanley" wrote in message ... I recorded the following code that should hide Col. F in Sheets 1, 2, and 3. This works fine when I record, but when I run the code manually Col. F hides on Sheet 1 only, while the column is merely selected on Sheets 2 & 3. Any idea what happens here? Thanks in advance! Sheets(Array("Sheet1", "Sheet2", "Sheet3")).Select Columns("F:F").Select Selection.EntireColumn.Hidden = True Sheets("Sheet1").Select End Sub |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Code not hiding columns
Don,
Thanks for the answer! I understand now why the original code didn't work. -----Original Message----- try Sub hidecolf() For Each ws In Sheets(Array("Sheet1", "Sheet2", "Sheet3")) ws.Columns("F:F").EntireColumn.Hidden = True Next ws End Sub -- Don Guillett SalesAid Software "Eva Shanley" wrote in message ... I recorded the following code that should hide Col. F in Sheets 1, 2, and 3. This works fine when I record, but when I run the code manually Col. F hides on Sheet 1 only, while the column is merely selected on Sheets 2 & 3. Any idea what happens here? Thanks in advance! Sheets(Array("Sheet1", "Sheet2", "Sheet3")).Select Columns("F:F").Select Selection.EntireColumn.Hidden = True Sheets("Sheet1").Select End Sub . |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Code not hiding columns
|
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Hiding VB Code | Excel Discussion (Misc queries) | |||
Hiding VB Code | Excel Discussion (Misc queries) | |||
Hiding Code | Excel Discussion (Misc queries) | |||
Hiding VBA code | Excel Programming | |||
hiding vba code | Excel Programming |