Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
learning VBA and Macros in Excel, so forgive my newbie-ness.
I have two button forms, each with it's own macro. Sub Button8_Click() Range("J2:Q2").Select Selection.EntireColumn.Hidden = True End Sub Sub Button9_Click() Range("I2:R2").Select Selection.EntireColumn.Hidden = False Range("G2").Select End Sub One button(8) hides columns, the other button(9) reveals them. Is there a simple bit of code that will allow me to combine these functions onto one button? The macro that runs on click would depend on the state of the sheet. If columns are hidden, the button would run the "unhide" macro; if columns are unhidden, the button would run the "hide" macro. Also, as a nice touch, the button text would change to reflect appropriate pending action. This is, I guess, a basic on/off situation, but I can't figure it out. :( |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
delete scripts | Excel Worksheet Functions | |||
Forumlas or scripts? | Excel Discussion (Misc queries) | |||
SQL Scripts in Excel | Excel Discussion (Misc queries) | |||
SQL scripts and ODBC | Excel Programming | |||
Macintosh and VB Scripts | Excel Programming |