Solved

Excel VBA - Hiding all Columns in a Named Range

Posted on 2016-10-24
7
52 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 400 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 100 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
Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

 

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

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

Excel can be a tricky bit of software to get your head around. Whilst you’ll be able to eventually get to grips with the basic understanding of how to get by, there are a few Excel tips that not everybody will even know about let alone know how to d…
Use Windows Task Scheduler to print a Word document weekly so your printer ink won't dry out.
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

688 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