ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to toggle (https://www.excelbanter.com/excel-programming/282621-how-toggle.html)

Cesar Zapata[_2_]

How to toggle
 
Hi guys,


I have a macro that unhides and hides some columns. I have a button that
toggles the macro depending on the label of the button.

But cause a button takes too much space,( I have other buttons there too) I
would like to know if there is a way to program a combination of keystrokes
to handle my macro. for example CTRL + "-" will hide columns and CTRL + "+"
will unhide them.


thanks/



Bob Phillips[_5_]

How to toggle
 
Cesar,

Select the columns, and goto DataGroup And OutlineGroup and group these
columns. You then get an outline symbol which allows you to collapse and
expand the hidden columns.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Cesar Zapata" wrote in message
...
Hi guys,


I have a macro that unhides and hides some columns. I have a button that
toggles the macro depending on the label of the button.

But cause a button takes too much space,( I have other buttons there too)

I
would like to know if there is a way to program a combination of

keystrokes
to handle my macro. for example CTRL + "-" will hide columns and CTRL +

"+"
will unhide them.


thanks/





Anders S

How to toggle
 
Cesar

See Application.OnKey in VBA Help.

HTH
Anders Silvén


"Cesar Zapata" skrev i meddelandet ...
Hi guys,


I have a macro that unhides and hides some columns. I have a button that
toggles the macro depending on the label of the button.

But cause a button takes too much space,( I have other buttons there too) I
would like to know if there is a way to program a combination of keystrokes
to handle my macro. for example CTRL + "-" will hide columns and CTRL + "+"
will unhide them.


thanks/



Don Guillett[_4_]

How to toggle
 
Why not just use the same shortcut with a toggle
Columns("g").EntireColumn.Hidden = _
Not Columns("g").EntireColumn.Hidden

--
Don Guillett
SalesAid Software

"Cesar Zapata" wrote in message
...
Hi guys,


I have a macro that unhides and hides some columns. I have a button that
toggles the macro depending on the label of the button.

But cause a button takes too much space,( I have other buttons there too)

I
would like to know if there is a way to program a combination of

keystrokes
to handle my macro. for example CTRL + "-" will hide columns and CTRL +

"+"
will unhide them.


thanks/






All times are GMT +1. The time now is 07:31 AM.

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