UserForm Label Caption Change Using CheckBox

Chubski

New Member
Joined
Apr 25, 2011
Messages
11
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:

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
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.

Forum statistics

Threads
1,224,597
Messages
6,179,808
Members
452,944
Latest member
2558216095

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top