Hi,
I created a cmdButton to clear the data filled in the userform.
The code is correct, but it only clears the information from the textboxes, not from the comboboxes.
I t has to be related to the Userform_Initialize code, but i can't figure it out.
Can anyone help me?
Thanks in advance
Private Sub cmdlclear_Click()
Dim confirm As Integer
confirm = MsgBox("are you certain you want to delete form?", vbYesNo + vbQuestion)
If confirm = vbYes Then
Call UserForm_Initialize
End If
End Sub
Private Sub UserForm_Initialize()
txtdataregisto = Format(Date, "dd-mm-yyyy")
txtID = valmax + 1
txtdossier.Value = ""
txtvalor.Value = ""
txtdataentrega.Value = ""
txtdataregularização.Value = ""
txtjurosindevidos.Value = ""
txtvalordeseguro.Value = ""
txtanulaçãodeis.Value = ""
txtanulaçãopenalidades.Value = ""
txtvalorrealpassagemaperdas.Value = ""
Me.cbocolaborador.List = Worksheets("Listas").Range("c3:c8").Value
Me.cboproduto.List = Worksheets("Listas").Range("B3:B13").Value
Me.cbooperação.List = Worksheets("Listas").Range("d3:d14").Value
Me.cbomotivo.List = Worksheets("Listas").Range("e3:e13").Value
Me.cboparceiro.List = Worksheets("Listas").Range("a3:a165").Value
End Sub
Bookmarks