Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / May 2006

Tip: Looking for answers? Try searching our database.

Hide non-contiguous columns

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
BEEJAY - 19 May 2006 14:39 GMT
Greetings:
Have for some time used the following in a number of applications
     Columns("F:G").Select
             Selection.EntireColumn.Hidden = True
Works Great:
Now I need to add column J, as well.
  After checking group sites, I tried:
          Columns("F:G,J").Select
          Columns("F:G,J:K").Select
          etc................. .
      F and G always hides fine
      J (and K) are to stubborn to disappear.

Then I read in one post to use "Select" as little as possible, so I changed to
     Range("F:G,J:K").EntireColumn.Hidden = True
           and variations thereof.
  Again, F and G disappear, J and K just keep hanging around.

Once again, I'm likely missing something obviouis, but I just can't find it.
Please help.

ALSO:  Why is it recommended to be good coding practice to use SELECT as
infrequently as possible?

Thanks
Bob Phillips - 19 May 2006 15:44 GMT
No need to select

   Range("F:G,J:L").EntireColumn.Hidden = False

--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)

> Greetings:
> Have for some time used the following in a number of applications
[quoted text clipped - 21 lines]
>
> Thanks
BEEJAY - 23 May 2006 13:25 GMT
Thanks, Bob.

> No need to select
>
[quoted text clipped - 35 lines]
> >
> > Thanks
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.