Converting dates entered

howard

Well-known Member
Joined
Jun 26, 2006
Messages
6,561
Office Version
  1. 2021
Platform
  1. Windows
I have a spreadsheet that contains dates amongst other items. Sometimes the opperator enters the date a dd/mm/yyyy for eg 01/10/2006 and sometimes as 10/01/2006. I want all dates entered as dd/mm/yyyy.

I would like VBA code to be written that will convert all dates entered as mm/dd/yyyy that is after the current date in cell A2 (i.e todays date 07//10/2006)

for eg if the date is entered as 07/12/2006 which is after the todays date 07/10/2006, then the date must be converted to 12/07/2006.

Your assistance will be most appreciated.

Howard
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
just use
=text(a1,"(any format)")
the format dd/mm'yyy ahould within quotation marks.
venkat
 
Upvote 0

Forum statistics

Threads
1,214,520
Messages
6,120,007
Members
448,935
Latest member
ijat

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top