ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Prog. Hide range and indiv. columns? (https://www.excelbanter.com/excel-programming/319713-prog-hide-range-indiv-columns.html)

No Name

Prog. Hide range and indiv. columns?
 
Is it possible to hide a range of columns programatically as well as
additional free floating columns elswhere on the work sheet.

For instance, this hides a range::

Columns("C:N").Select
Selection.EntireColumn.Hidden = True

But, what I really want to achieve is this:

Columns("C:N, P, Y, W").Select
Selection.EntireColumn.Hidden = True

....Of course, this throws up an error...is there a way to rephrase this code
to make it do what I want?

Many thanks
Jason

Excel 2000








Dave Peterson[_5_]

Prog. Hide range and indiv. columns?
 
I use this kind of syntax:

Range("C:N,P:P,Y:Y,W:W").EntireColumn.Hidden = True

wrote:

Is it possible to hide a range of columns programatically as well as
additional free floating columns elswhere on the work sheet.

For instance, this hides a range::

Columns("C:N").Select
Selection.EntireColumn.Hidden = True

But, what I really want to achieve is this:

Columns("C:N, P, Y, W").Select
Selection.EntireColumn.Hidden = True

...Of course, this throws up an error...is there a way to rephrase this code
to make it do what I want?

Many thanks
Jason

Excel 2000


--

Dave Peterson

Bob Phillips[_6_]

Prog. Hide range and indiv. columns?
 
Hi Jason,

Range("C:N,P:P,Y:Y,W:W").EntireColumn.Hidden = True


--

HTH

RP
(remove nothere from the email address if mailing direct)


wrote in message
...
Is it possible to hide a range of columns programatically as well as
additional free floating columns elswhere on the work sheet.

For instance, this hides a range::

Columns("C:N").Select
Selection.EntireColumn.Hidden = True

But, what I really want to achieve is this:

Columns("C:N, P, Y, W").Select
Selection.EntireColumn.Hidden = True

...Of course, this throws up an error...is there a way to rephrase this

code
to make it do what I want?

Many thanks
Jason

Excel 2000










No Name

Prog. Hide range and indiv. columns?
 
Awesome thank you!

"Dave Peterson" wrote in message
...
I use this kind of syntax:

Range("C:N,P:P,Y:Y,W:W").EntireColumn.Hidden = True

wrote:

Is it possible to hide a range of columns programatically as well as
additional free floating columns elswhere on the work sheet.

For instance, this hides a range::

Columns("C:N").Select
Selection.EntireColumn.Hidden = True

But, what I really want to achieve is this:

Columns("C:N, P, Y, W").Select
Selection.EntireColumn.Hidden = True

...Of course, this throws up an error...is there a way to rephrase this

code
to make it do what I want?

Many thanks
Jason

Excel 2000


--

Dave Peterson





All times are GMT +1. The time now is 05:30 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com