Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I would **not** use the following in production code... I'm posting it more
to get the reader to see there are ways to "think outside the box" when it comes to coding (and, also, as an exercise for the reader to decipher why it works<g)... Private Sub CommandButton1_Click() Range("A1").Value = String(1 - Val(Range("A1").Value), "1") CommandButton1.Caption = Split("EDIT DONE")(Val(Range("A1").Value)) End Sub Rick "Rick Rothstein (MVP - VB)" wrote in message ... Maybe this? Private Sub CommandButton1_Click() With CommandButton1 If .Caption = "DONE" Then ActiveSheet.Range("A1").Value = "" .Caption = "EDIT" Else ActiveSheet.Range("A1").Value = "1" .Caption = "DONE" End If End With End Sub Rick "Les Stout" wrote in message ... Hi all, this is probably so easy but it is eluding me !! I need to make an edit button that inserts a 1 in A1 and the caption then changes to "DONE" and when clicked again it removes the 1 from A1 and the caption then changes back to "EDIT" Best regards, Les Stout *** Sent via Developersdex http://www.developersdex.com *** |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Shortcut to switch from "fill down" to "copy" with mouse drag | Excel Discussion (Misc queries) | |||
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell | Excel Discussion (Misc queries) | |||
toggle between autofilter Criteria1:= "*" and "all" | Excel Programming | |||
Import data "Hangs", A "time out" is needed. Help! :) | Excel Programming | |||
Why does excell switch my stock symbol "ACN" to "CAN"? | Setting up and Configuration of Excel |