Solved

Excel VBA - Hiding all Columns in a Named Range

Posted on 2016-10-24
7
31 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 45

Assisted Solution

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

Expert Comment

by:Martin Liss
ID: 41857579
Beaten by 41 seconds:(
0
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 

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 45

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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Workbook link problems after copying tabs to a new workbook? David Miller (dlmille) Intro Have you either copied sheets to a new workbook, and after having saved and opened that workbook, you find that there are links back to the original sou…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

708 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

13 Experts available now in Live!

Get 1:1 Help Now