Using DateAdd with a text string

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a textbox that I am entering a date and want to do some date calculations on it

I have the following but my suspician is this is returning a strin

Startdate = Format(UserForm1.TextBox1, "dd-mm-yyyy 00:00:00"

I tried the following but it there is a Type Mismatc

Startdate = DateAdd(m, -1, Format(UserForm1.TextBox1, "dd-mm-yyyy 00:00:00")

Do I need to do something else so this can be manipulated using DateAdd metho

Max
 
The Format function yields a string. Try converting it back to a date using
the DateValue function.
 
Back
Top