Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default 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
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default 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



.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hiding VB Code baz Excel Discussion (Misc queries) 4 May 5th 10 05:51 PM
Hiding VB Code johnsail Excel Discussion (Misc queries) 6 March 9th 09 07:53 PM
Hiding Code Jae Excel Discussion (Misc queries) 3 August 10th 05 08:10 PM
Hiding VBA code David Wooddall-Gainey Excel Programming 4 August 22nd 03 06:45 PM
hiding vba code Richard Choate Excel Programming 0 July 17th 03 08:33 PM


All times are GMT +1. The time now is 10:14 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"