date format

Forestq

Active Member
Joined
May 9, 2010
Messages
482
Hi,

in csv file I have column, where are date's with diffrent format as below:

02/03/2014 00:10
1/02/2014 7:25:00
7/03/2013 8:30:00 PM

I want to set up the same format for all date's.

I`m doing something like:
Code:
With WS

LastRow = WS.Cells(WS.Rows.Count, "A").End(xlUp).Row
 .Range("T" & LastRow).Selection.NumberFormat = "dd/mm/yyyy hh:mm:ss"

End With

but is going wrong.

Any idea how to do it?
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
Hi Forestq,

Your code only works on the last used cell in column T, are you looking for something like this? (ps: code not tested)
Code:
WS.RANGE("T1:T" & RANGE("A"&ROWS.COUNT).END(xlUp).Row).NumberFormat = "dd/mm/yyyy hh:mm:ss"[COLOR=#222222][FONT=Verdana]
[/FONT][/COLOR]</pre>
 
Upvote 0
works ok, but in csv date has custom format: dd/mm/yyyy hh:mm

while is displaying dd/mm/yyyy hh:mm:ss
 
Upvote 0
I don't think I could understand your issue well, could you put up sample table with expected result?
 
Upvote 0

Forum statistics

Threads
1,223,630
Messages
6,173,456
Members
452,514
Latest member
cjkelly15

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