Convert "General" format to "Date" format using VBA

xlhelp15

Board Regular
Joined
Sep 12, 2014
Messages
116
Office Version
  1. 365
Platform
  1. Windows
  2. Mobile
  3. Web
Hello Genius,

Kindly help me on the below requirement.

Actually I have data in the format of "General" which has Date & Time in that. I need to convert it to Date format.

From : Dec 5 2018 2:46PM

to : 12/05/18 or 12/05/2018.

Your help is greatly appreciated !

Thanks.
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
You can get this VBA code very easily yourself.
All you have to do is turn on the Macro Recorder, and record yourself manually changing the format of a cell to your desired format.
Then stop the recorder and view your code.

This is a great way to get simple code snippets without having to know how to write VBA.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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