ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Macro for Show/Hide Column (https://www.excelbanter.com/excel-discussion-misc-queries/594-re-macro-show-hide-column.html)

Andy

Macro for Show/Hide Column
 
worked well. chose this one.

"tjtjjtjt" wrote:

Here's a basic macro that will do it:

Sub HideColD()
Columns("D:D").Select
If Selection.EntireColumn.Hidden = False Then
Selection.EntireColumn.Hidden = True
Else
Selection.EntireColumn.Hidden = False
End If
Range("D1").Select
End Sub


tj

"Andy" wrote:

Hi

I am trying to write a Macro to Toggle Show/Hide column D

Anybody able to help?

with thanks...Andy



Andy

hi don, i used this for another column requirement....thanks

"Don Guillett" wrote:

or

Sub togglehide()
columns("d").Entirecolumn.Hidden = True = Not _
columns("d").Entirecolumn.Hidden = True
End Sub


--
Don Guillett
SalesAid Software

"tjtjjtjt" wrote in message
...
Here's a basic macro that will do it:

Sub HideColD()
Columns("D:D").Select
If Selection.EntireColumn.Hidden = False Then
Selection.EntireColumn.Hidden = True
Else
Selection.EntireColumn.Hidden = False
End If
Range("D1").Select
End Sub


tj

"Andy" wrote:

Hi

I am trying to write a Macro to Toggle Show/Hide column D

Anybody able to help?

with thanks...Andy






Don Guillett

Why? All 3 did the same thing and Bob's was the most efficient.

--
Don Guillett
SalesAid Software

"Andy" wrote in message
...
worked well. chose this one.

"tjtjjtjt" wrote:

Here's a basic macro that will do it:

Sub HideColD()
Columns("D:D").Select
If Selection.EntireColumn.Hidden = False Then
Selection.EntireColumn.Hidden = True
Else
Selection.EntireColumn.Hidden = False
End If
Range("D1").Select
End Sub


tj

"Andy" wrote:

Hi

I am trying to write a Macro to Toggle Show/Hide column D

Anybody able to help?

with thanks...Andy






All times are GMT +1. The time now is 01:28 PM.

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