Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Toggling display
Hi,
Cell B5 is named "status". I'm looking for a macro to be attached to a button. When I click the button once, it shows the word, "On". Clicking it again it now shows the word "Off", and continues to toggle. Any help ? TIA Tom |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Toggling display
hi
what kind of button? Command button on the sheet? Private Sub CommandButton1_Click() If Range("B5").Value = "On" Then Range("B5").Value = "Off" Else Range("B5").Value = "On" End If End Sub regards FSt1 "Tom" wrote: Hi, Cell B5 is named "status". I'm looking for a macro to be attached to a button. When I click the button once, it shows the word, "On". Clicking it again it now shows the word "Off", and continues to toggle. Any help ? TIA Tom |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Toggling display
Here is one I did a long time ago. Create a shape and NAME it toggleit
Sub chgtextontoggleit() ActiveSheet.Shapes("toggleit").Select With Selection If .Characters.Text = "ON" Then msg = "OFF" Else msg = "ON" End If ..Characters.Text = msg End With Range("a1").Select End Sub -- Don Guillett Microsoft MVP Excel SalesAid Software "Tom" wrote in message ... Hi, Cell B5 is named "status". I'm looking for a macro to be attached to a button. When I click the button once, it shows the word, "On". Clicking it again it now shows the word "Off", and continues to toggle. Any help ? TIA Tom |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Toggling display
Your efforts are much appreciated Don Guillett and FSt1 once again.
Regards, Tom "Tom" wrote in message ... Hi, Cell B5 is named "status". I'm looking for a macro to be attached to a button. When I click the button once, it shows the word, "On". Clicking it again it now shows the word "Off", and continues to toggle. Any help ? TIA Tom |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Help with toggling display | Excel Discussion (Misc queries) | |||
toggling checkboxes | Excel Programming | |||
toggling between 2 workbooks | Excel Programming | |||
toggling | Excel Worksheet Functions | |||
Toggling Display as Icon for OLE Object | Excel Programming |