Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 71
  • Last Modified:

Excel VBA - Hiding all Columns in a Named Range

I have a named range called "HideTheseColumns". It is 5 rows by 10 columns (say). I'm looking for an elegant way of coding a 'hide columns' procedure.

This code didn't work.
Range("HideTheseColumns").Columns.EntireColumn.Hidden = False

Open in new window


Thanks
0
hindersaliva
Asked:
hindersaliva
  • 3
  • 3
2 Solutions
 
NorieVBA ExpertCommented:
Try this.
Range("HideTheseColumns").EntireColumn.Hidden = True

Open in new window

0
 
Martin LissOlder than dirtCommented:
Range("HideTheseColumns").Columns.EntireColumn.Hidden = True
0
 
Martin LissOlder than dirtCommented:
Beaten by 41 seconds:(
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
hindersalivaAuthor Commented:
Haha! That's what I had BUT ........ I put 'False' and expecting the columns to hide! Doh!

Thanks!
0
 
Martin LissOlder than dirtCommented:
Please don't forget to give Norie the credit when you close this question.
0
 
hindersalivaAuthor Commented:
BTW they both work, ie. with 'Columns' and without.
0
 
hindersalivaAuthor Commented:
Thanks both of you.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now