I needed to convert date which is in "DD.MM.YYYY" to date format "DD/MM/YYYY" in cells J3:J400 of my worksheet.
For Ex.
To convert date 31.12.2018 to 31/12/2018
To convert date 01.01.2019 to 01/01/2019
To convert date 02.01.2019 to 02/01/2019
I needed to convert date which is in "DD.MM.YYYY" to date format "DD/MM/YYYY" in cells J3:J400 of my worksheet.
For Ex.
To convert date 31.12.2018 to 31/12/2018
To convert date 01.01.2019 to 01/01/2019
To convert date 02.01.2019 to 02/01/2019
Select J3:J400, goto Data>Text to columns..., on the 3rd step select DMY from the column Data format drop down and click Finish.
If posting code please use code tags, see here.
Can I do the same using Event macro code for my particular sheet?
What event would trigger the code?
If user type or copy paste date as "dd.mm.yyyy" format in column J3 to J400 then it should auto convert into "dd/mm/yyyy" format.
try
Please Login or Register to view this content.
Regards,
MohanS
"Perfection is not attainable, but if we chase perfection we can catch excellence." - Vince Lombardi
You can simply say thanks by clicking "*Add Reputation" icon
for range you specifiedPlease Login or Register to view this content.
Last edited by nigelog; 01-16-2019 at 08:42 AM.
Change
Please Login or Register to view this content.
Ok. It worked. Thanks.
Glad you got it sorted. Thanks for the rep.
Can I do that on Only those cells in column J in which the date is in dd.mm.yyyy format.
I don't want to convert text to columns in column J in which the date is in other format except dd.mm.yyyy.
I needed to add that settings in my below code.
Please Login or Register to view this content.
what other formats do dates appear in? Perhaps something like below, it assumes the cell contains 10 characters and 2 of these are "."
Please Login or Register to view this content.
Last edited by davsth; 01-21-2019 at 05:19 AM.
When i'm copy and pasting data to my sheet, the code is giving type mismatch inPlease Login or Register to view this content.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks