• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 68
  • 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
 
NorieData ProcessorCommented:
Try this.
Range("HideTheseColumns").EntireColumn.Hidden = True

Open in new window

0
 
Martin LissRetired ProgrammerCommented:
Range("HideTheseColumns").Columns.EntireColumn.Hidden = True
0
 
Martin LissRetired ProgrammerCommented:
Beaten by 41 seconds:(
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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

Thanks!
0
 
Martin LissRetired ProgrammerCommented:
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

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

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