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

xlhelp15

Board Regular
Joined
Sep 12, 2014
Messages
113
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

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
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,214,573
Messages
6,120,318
Members
448,956
Latest member
Adamsxl

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