Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Possibly:
Startdate = Format(cdate(UserForm1.TextBox1), "dd-mm-yyyy 00:00:00") -- regards, Tom Ogilvy "Max" wrote in message ... 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 string Startdate = Format(UserForm1.TextBox1, "dd-mm-yyyy 00:00:00") I tried the following but it there is a Type Mismatch 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 method Max |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The Format function yields a string. Try converting it back to a date using
the DateValue function. -- Vasant "Max" wrote in message ... 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 string Startdate = Format(UserForm1.TextBox1, "dd-mm-yyyy 00:00:00") I tried the following but it there is a Type Mismatch 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 method Max |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Change 3 letter text string to a number string | Excel Discussion (Misc queries) | |||
Dateadd function | Excel Discussion (Misc queries) | |||
dateadd | Excel Discussion (Misc queries) | |||
Using DateAdd Function with cell values | Excel Discussion (Misc queries) | |||
DateAdd function | Excel Programming |