View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Don Guillett[_4_] Don Guillett[_4_] is offline
external usenet poster
 
Posts: 2,337
Default 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