Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
DTM DTM is offline
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
passing values to other sheets [email protected] New Users to Excel 1 February 23rd 08 02:03 AM
Passing variable values to userform control KJ-clueless Excel Discussion (Misc queries) 2 November 27th 07 10:51 PM
Passing values in Sheet to VBA Jonathan Charts and Charting in Excel 1 June 30th 06 06:00 AM
UserForm not passing Boolean variable Chip Pearson Excel Programming 2 July 19th 03 06:06 PM
Passing a value to a variable from Userform Neal Steiner Excel Programming 1 July 18th 03 09:12 PM


All times are GMT +1. The time now is 04:42 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"