PDA

View Full Version : [SOLVED] Bypass Run-time error '13'?



CuriousGeorg
09-30-2013, 02:31 AM
Good morning,

I know why I get the above error, it appears when a certain field in the userform is empty (the last set of number)

Is there a way I can by pass this or get around it ?

Aussiebear
09-30-2013, 02:33 AM
First impression is fill the field with a value. If its numeric then a zero should suffice.

CuriousGeorg
09-30-2013, 03:10 AM
If there something in it.. its fine 10629 is the part of the user form that breaks

and this is the code to send it to spreadsheet

.Offset(RowCount, 14).Value = CDate(Me.cboDay3.Value & "/" & Me.cbomonth3.Value & "/" & Me.cboYear3.Value & " " & Me.TextBox3.Value)


I'm assuming its because I'm asking the VBA to input / when there's a blank entry?


EDIT: figured a work around.. not ideal.. but ive removed CDate.. and formatted the cell in the workbook. Few rounds of testing and ill need to ensure it pulls a date through correctly.

snb
09-30-2013, 05:01 AM
.Offset(RowCount, 14).Value = CDate(cboDay3.Value & "/" & cbomonth3.Value & "/" & cboYear3.Value) + format(TextBox3.Value,"0.0")