Search code examples
excelvbauserform

Excel VBA - Save Userform Changes


Is it possible to save changes to a Label Caption in a userform in Excel VBA, so that they are permanently saved, and only changed when you enter a new change? I have checked, that the code is changing the caption, but I cannot get it to stick, so that it is still there next time I open the userform. Thank you in advance

Private Sub cmdSubmit_Click()

'resets participants email and name
    If Me.optProg.Value = True Then
        Me.NameLabelProg.Caption = Me.CB_Part.Value
        Me.MailLabelProg.Caption = Me.TB_Mail.Value
    ElseIf Me.optTester.Value = True Then
        Me.MailLabelTest.Caption = Me.CB_Part.Value
        Me.NameLabelTest.Caption = Me.TB_Mail.Value
    End If
    
End Sub

Solution

  • Check out this userform example and you'll find answers to many of your questions.

    enter image description here

    Source of userform