![]() |
Date in VBA
Hi guys.
I have three variables, day, month and year. How to create a valid date from them. CDate needs expression, but it depends on regional settings, so CDate ("5/6/2006") will return May 6th, or June 5th depends on settings. I need something more universal. Does it exist? |
Date in VBA
Try DateSerial something like this...
MsgBox DateSerial(2005, 5, 6) -- HTH... Jim Thomlinson "witek" wrote: Hi guys. I have three variables, day, month and year. How to create a valid date from them. CDate needs expression, but it depends on regional settings, so CDate ("5/6/2006") will return May 6th, or June 5th depends on settings. I need something more universal. Does it exist? |
Date in VBA
Jim Thomlinson wrote:
Try DateSerial something like this... MsgBox DateSerial(2005, 5, 6) Yes, Thanks. |
All times are GMT +1. The time now is 03:07 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com