Excel – VBA – How To change command button’s Caption after Single Click

SCENARIO:

Hi, i would like to change the caption of "ADD" to "SAVE" when it is pressed at run time.

Could somebody is there to help me in this regard.

SOLUTION:

Option Explicit 

Public Sub Command1_Click()
If Command1.Caption = "SAVE" Then
Command1.Caption = "ADD"
'Put Save commands here
Else
Command1.Caption = "SAVE"
'put ADD COMMAND BUTTON Commands here
End If
End Sub
SOURCE

LINK (Daniweb.com)

LANGUAGE
ENGLISH

1 thought on “Excel – VBA – How To change command button’s Caption after Single Click”

Comments are closed.