Change a CommandButton caption during a called routine from A to B then back to A
Posted on 2014-07-24
As written, I am stymied as to how to do the following:
Using a command button on a sheet to delete user 671 possible entries (to clear the user entries for reuse) with the intent to
1) change the caption while the called macro runs and then
2) return the caption to its earlier text...
2a) when the called macro completes its routine, and/or
2b) when the called macro is killed (if the user hits the [Esc] key)
Here's what I have so far:
Private Sub CommandButton1_Click()
'Resets Scores to zero by erasing 671 cells on 176 rows
If .Caption = "Click to Clear all ''X'' entries" Then
.Caption = "macro is running & deleting ''X'' entries"
ElseIf .Caption = "macro is running & deleting ''X'' entries" Then
.Caption = "Click to Clear all ''X'' entries"
Do I have to place the entire called macro within the CommandButton1_Click() routine or is there another way to get the caption to change during the clearXentries macro 5-minute runtime?