Hello I am having an error with this code at the Line Else I want it to change the caption if a name has been entered if not then exit
Private Sub cmdButton_Click()
Dim name As String
With cmdButton
If .Caption = "CommandButton1" Then
name = InputBox("Enter Template Name.")
End If
If StrPtr(name) = 0& Then Exit Sub
Else
.Caption = name
End If
End With
End Sub