?
Solved

Excel VBA - Hiding all Columns in a Named Range

Posted on 2016-10-24
7
Medium Priority
?
58 Views
Last Modified: 2016-10-24
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
Comment
Question by:hindersaliva
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
7 Comments
 
LVL 34

Accepted Solution

by:
Norie earned 1600 total points
ID: 41857577
Try this.
Range("HideTheseColumns").EntireColumn.Hidden = True

Open in new window

0
 
LVL 48

Assisted Solution

by:Martin Liss
Martin Liss earned 400 total points
ID: 41857578
Range("HideTheseColumns").Columns.EntireColumn.Hidden = True
0
 
LVL 48

Expert Comment

by:Martin Liss
ID: 41857579
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!

 

Author Comment

by:hindersaliva
ID: 41857583
Haha! That's what I had BUT ........ I put 'False' and expecting the columns to hide! Doh!

Thanks!
0
 
LVL 48

Expert Comment

by:Martin Liss
ID: 41857587
Please don't forget to give Norie the credit when you close this question.
0
 

Author Comment

by:hindersaliva
ID: 41857589
BTW they both work, ie. with 'Columns' and without.
0
 

Author Closing Comment

by:hindersaliva
ID: 41857590
Thanks both of you.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
There are times when I have encountered the need to decompress a response from a PHP request. This is how it's done, but you must have control of the request and you can set the Accept-Encoding header.
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question