Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Userform and passing date values
Hi all,
Hey I have a userform in which I want the user to enter a date in a field (NZ dd/mm/yy). First of all is there anyway to format the text box to be a date format? but more importantly - when the value is passed to the cell I want to put it in - if the date is for example 05/04/03 (5th April 03) on the form - it enters the value 04/05/03 (4th May 03) no matter how I format the cell or the date to use the NZ format of day/month/year it comes back month/day/year. This only happens when the day/months could be reversible. IE if I enter 23/6/03 it treats it like I want it to dd/mm/yy. the code I'm using to pass the variable to the cell is: NextRow = Application.WorksheetFunction.CountA(Range ("D:D")) + 5 etc etc Cells(NextRow, 3) = Referral_date.Text thanks for any help dean |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Userform and passing date values
Can't format a textbox.
Cells(NextRow, 3) = cDate(Referral_date.Text) Might help. Regards, Tom Ogilvy DTM wrote in message ... Hi all, Hey I have a userform in which I want the user to enter a date in a field (NZ dd/mm/yy). First of all is there anyway to format the text box to be a date format? but more importantly - when the value is passed to the cell I want to put it in - if the date is for example 05/04/03 (5th April 03) on the form - it enters the value 04/05/03 (4th May 03) no matter how I format the cell or the date to use the NZ format of day/month/year it comes back month/day/year. This only happens when the day/months could be reversible. IE if I enter 23/6/03 it treats it like I want it to dd/mm/yy. the code I'm using to pass the variable to the cell is: NextRow = Application.WorksheetFunction.CountA(Range ("D:D")) + 5 etc etc Cells(NextRow, 3) = Referral_date.Text thanks for any help dean |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Userform and passing date values
Thanks Tom,
that works -----Original Message----- Can't format a textbox. Cells(NextRow, 3) = cDate(Referral_date.Text) Might help. Regards, Tom Ogilvy |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
passing values to other sheets | New Users to Excel | |||
Passing variable values to userform control | Excel Discussion (Misc queries) | |||
Passing values in Sheet to VBA | Charts and Charting in Excel | |||
UserForm not passing Boolean variable | Excel Programming | |||
Passing a value to a variable from Userform | Excel Programming |