Hello,
I'm trying to change a label on a UserForm.
If a checkbox is selected an inputbox appears asking for the date of a letter sent to a client. If an entry is input it is added to the existing label.
This part works fine but I also need to return the label back to its original version if the checkbox is unselected and its value returns to False.
Please see the following:
I'd appreciate a steer to just finish this off so that it works for both True and False values of the CheckBox8.
Thanks and regards
Chubski
I'm trying to change a label on a UserForm.
If a checkbox is selected an inputbox appears asking for the date of a letter sent to a client. If an entry is input it is added to the existing label.
This part works fine but I also need to return the label back to its original version if the checkbox is unselected and its value returns to False.
Please see the following:
Code:
Private Sub CheckBox8_Click()
Dim strName As String
If Userform.CheckBox8.Value = True Then
Application.ScreenUpdating=False
strName = InputBox(Prompt:=Date of letter to client.", _
Title:="ENTER DATE - FORMAT OF YOUR CHOOSING", Default:="DDth Mmmmmmmmm YYYY")
End If
If strName = "ddth Mmmmmmmmm YYY" Or _
strName = vbNullString Then
Userform.CheckBox8.Value = False
Exit Sub
Else
Sheets("Data").Range("X45") = "Yes"
End If
With Userform
Label13 = "Your details remain unchanged as detailed in my letter of " & strName & "."
End With
Application.ScreenUpdating = True
strName = ""
If Userform.CheckBox8.Value = False Then
With Header
Label 13 = "Your details remain unchanged as detailed in my letter of ........"
End With
Sheets("Data").Range("X45")= "No"
End If
End Sub
I'd appreciate a steer to just finish this off so that it works for both True and False values of the CheckBox8.
Thanks and regards
Chubski