Hello:
I have F5="Tuesday, June 1, 2021 - Wednesday, June 30, 2021"
I need Excel formula or VB Code to get N1=MM-YYYY so N1=06-2021
Please let me know if you have any questions.
Thanks.
Riz
Hello:
I have F5="Tuesday, June 1, 2021 - Wednesday, June 30, 2021"
I need Excel formula or VB Code to get N1=MM-YYYY so N1=06-2021
Please let me know if you have any questions.
Thanks.
Riz
To get the first date, use:Format as "mm-yyyy".Formula:Please Login or Register to view this content.
Trevor Shuttleworth - Retired Excel/VBA Consultant
I dream of a better world where chickens can cross the road without having their motives questioned
'Being unapologetic means never having to say you're sorry' John Cooper Clarke
Try this, N1: =DATEVALUE(MID(F5,FIND(",",F5)+2,3)&"-"&RIGHT(F5,4))
Hello:
I need to use above to put in VB Code
Range("N1").Formula = "=datevalue(mid(f5,find(",",f5)+2,3)&"-"&right(f5,4))"
Its giving error.
Can you please with it.
R
Double up the quotes.
Try:Please Login or Register to view this content.
Hello:
Thanks TMS and joseph
Works for me.
R
If the text in F5 is enclosed with double-quotes, then =DATEVALUE(MID(F5,FIND(",",F5)+2,3)&" - "&MID(F5,FIND(" -",F5)-4,4)).
You're welcome. Thanks for the rep.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks