Private Sub CommandButton1_Click()
If CommandButton1.Caption = "Button1" Then
CommandButton1.Caption = "Output"
Else
CommandButton1.Caption = "Button1"
End If
End Sub
Public Sub Change_Caption()
With ActiveSheet.Buttons("Button 1")
If .Caption = "Button 1" Then
.Caption = "Output"
Else
.Caption = "Button 1"
End If
End With
End Sub
Public Sub Change_Caption()
With ActiveSheet.Buttons("Button 1")
If .Caption = "Button 1" Then
.Caption = "Output"
Else
.Caption = "Button 1"
End If
End With
End Sub
Let me tell you what problem I am facing. Actually I have some pictures in my sheet and I have assigned same userform to all the pictures. Now I want the picture name on which I have clicked to run the macro. (I have to apply If condition on that result)