Akuini
Well-known Member
- Joined
- Feb 1, 2016
- Messages
- 5,273
- Office Version
- 365
- Platform
- Windows
Akuini submitted a new Excel article:
Excel VBA: Function to Obtain Correct Date Format When Converting Text to Date - How to get date format as expected when converting text to date
Read more about this Excel article...
Excel VBA: Function to Obtain Correct Date Format When Converting Text to Date - How to get date format as expected when converting text to date
Dealing with dates in VBA can be a bit tricky. When attempting to convert a string to a date, we may encounter unexpected results. The issues typically arise in the following ways:
- The day, month, and year might get swapped or changed unintentionally.
- What we typically consider as an incorrect date format may actually be considered valid by VBA.
My Windows date setting uses d-m-y format, so all examples below generate results base on that setting.
Example 1:
Using CDate, the day &...
Read more about this Excel article...