Solved

Excel VBA - Hiding all Columns in a Named Range

Posted on 2016-10-24
7
38 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
  • 3
  • 3
7 Comments
 
LVL 33

Accepted Solution

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

Open in new window

0
 
LVL 46

Assisted Solution

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

Expert Comment

by:Martin Liss
ID: 41857579
Beaten by 41 seconds:(
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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 46

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
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…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

920 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now