Having said this, I am trying to read dates in text files that are formatted dd-mmm-yy, for example 30-NOV-23 for the end of last month. Is there some slick way to convert a string date such as 30-NOV-23 to a vba date?
I've also got text files that have the date formatted as mmmm d, yyyy. Could I mess with my regional settings in code just long enough to read the date & then reset them? Ideally, i guess that I'd like the reverse of the format function:
Code: Select all
Sub test()
Dim s As String, d As String
s = "30-NOV-23"
d = ReadDate(s, "dd-mmm-yy")
' d on my computer would be 2023-11-30
End Sub