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
hindersalivaAsked:
Who is Participating?
 
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: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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.

All Courses

From novice to tech pro — start learning today.