Code not hiding columns

  • Thread starter Thread starter Eva Shanley
  • Start date Start date
E

Eva Shanley

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
 
try
Sub hidecolf()
For Each ws In Sheets(Array("Sheet1", "Sheet2", "Sheet3"))
ws.Columns("F:F").EntireColumn.Hidden = True
Next ws
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top