Fixing Date Data

cstimart

Well-known Member
Joined
Feb 25, 2010
Messages
1,180
When I extract my data, not all of the dates are in the same format. I can format the date to appear as mm/dd/yyyy, however, the value in some of the cells still includes time detail. How do I get rid of the time and retain the date?
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
Cell D2 shows "03/19/2002 1:00:00 AM"

In D3 I used =TRUNC(D2,10) and it displays "03/19/2002"...if I then copy/paste value I get "03/19/2002 1:00:00 AM"
 
Upvote 0
Is there a way in VBA to Format the entire column as "mm/dd/yyyy" without using a for/next loop? I have nearly 20k entries, and the list grows.

I tried the following, but it crashed.

Code:
Columns("E:G").NumberFormat = "mm/dd/yyyy"
 
Upvote 0
That is only changing the displayed value, not the underlying value. You would need to loop and use INT().
 
Upvote 0

Forum statistics

Threads
1,224,616
Messages
6,179,908
Members
452,949
Latest member
beartooth91

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