Hi All.
Sorry.....only new to this forum and posted this on my welcome page.
Anyway.....I have setup a userform with many textboxes and all i am seeking to do is transfer the userform info onto my spreadsheet. The code i have is;
Private Sub CommandButton2_Click()
Sheet2.Range("B3").Value = TextBox1.Text
Sheet2.Range("B11").Value = TextBox12.Text
Sheet2.Range("B12").Value = TextBox2.Text
Sheet2.Range("B19").Value = TextBox15.Value
Sheet2.Range("B22").Value = TextBox16.Value
Sheet2.Range("B25").Value = TextBox17.Value
Sheet2.Range("D12").Value = DateValue(Me.TextBox3.Value)
Sheet2.Range("B13").Value = TextBox4.Text
Sheet2.Range("D13").Value = DateValue(Me.TextBox5.Value)
Sheet2.Range("B14").Value = TextBox6.Text
Sheet2.Range("D14").Value = DateValue(Me.TextBox7.Value)
Sheet2.Range("B15").Value = TextBox8.Text
Sheet2.Range("D15").Value = DateValue(Me.TextBox9.Value)
Sheet2.Range("B17").Value = TextBox10.Value
Sheet2.Range("B16").Value = TextBox11.Value
Sheet2.Range("F10").Value = DateValue(Me.TextBox14.Value)
Sheet2.Range("B7").Value = DateValue(Me.TextBox13.Value)
MsgBox "One record written to Superfund details Sheet"
Unload Me
End Sub
The problem is that i have six date fields (representing dates of birth and other important dates), and not all of these are required to be filled out by the user (ie - they are not mandatory). Problem is that if the user does not fill them out i get the runtime error 13 message "type mismatch", and the debugger is struggling with the fact that all date fields are not filled out. Does anyone know how to fix this? Cheers.
Bookmarks