This is a date in text format "Wednesday, July 1, 2018". How can I could convert it to real date? The result is 1/7/2018
This is a date in text format "Wednesday, July 1, 2018". How can I could convert it to real date? The result is 1/7/2018
Try this:
Formula:Please Login or Register to view this content.
Thanks. I got #VALUE# error.
Does this formula work for you...
=0+TRIM(SUBSTITUTE(MID(A1,FIND(" ",A1,FIND(" ",A1)+1),3),","," ")&MID(A1,FIND(" ",A1)+1,3)&RIGHT(A1,5))
Thanks a lot Rick. That works. I got dash as delimeeter inside date. How could got / instead?
It works for the sample you provided. Please attach your file for a more specific response.
date.JPG
@6StringJazzer,
I've run into the problem with your solution myself. It seems that some "standard" date formats here in the US do not work at all overseas. My recollection is that the Month Day, Year format is one of those.
@KingTamo,
My code returns a real date so you can simply Custom Format the cell with the date format of your choosing.
Last edited by Rick Rothstein; 06-22-2020 at 08:32 PM.
Thanks a lot Rick. It works well now. How can I use it in the macros section?
Try integrating this into your code...
Please Login or Register to view this content.
I got a error at the last line of the code. Type mismatch.
We are back to that problem with international date formats. Try replacing that line of code with this and see if that works...
RealDate = CDate(Arr(2) & "-" & Arr(1) & "-" & Arr(3))
Sorry but the same error.
Okay, let's see if we can bypass VBA's attempt to form a date from a text string and do it the long way. Does this work for you...
Please Login or Register to view this content.
Thanks a lot Rick sir. This solved the my problem.
Great... I am glad we finally got this sorted out. I am going to save my solution in a file so I can reuse it should this or a similar question come up in this forum in the future.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks