![]() |
Date Formats
i am having a bit of a problem with date format
manipulation. I capture a date from a text box on a form and write it to a cell on a worksheet, in the process the date switches from UK (dd/mm/yy) to US (mm/dd/yy) format, despite the fact that it appears on the form in the UK style and the cell in the worksheet has the UK date format set. Any advice? This is the code fragment if it is on any use: A) tmpStr = Form1.Textbox1.text B) Selection.Formula = tmpstr Fragment (A) is in one procedure fragment (B) is in another, no other manipulation takes place. I have even tried using Format(tmpstr, "dd/mm/yy") Murray |
Date Formats
Dave,
Many thanks for your detailed reply. Iam using Xl2000 on XP Pro, I have everything set to use the local UK (dd/mm/yyyy) settings and have played about with this for ages. Working from your examples I eventually sorted the problem by actually picking the tmpstr date from the text box, formatting it to the US format then processing it via my code. It now reports the date in the UK format when viewed in the sheet. Very weird! Murray (remove mapson from email address) *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
Date Formats
Murray
You may have more success with A) tmpStr = Form1.Textbox1.tex B) Selection.Value = CDate(tmpstr James. |
Date Formats
Thanks for the suggestion,I'll give it a go.
Murray (remove mapson from email address) *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
All times are GMT +1. The time now is 08:39 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com