Help in changing UDT DATE format plz

excelslave

New Member
Joined
Nov 8, 2005
Messages
7
I'd like to thank anyone in advance for help on this.

I have a row of UDT date time stamps that are formatted as TEXT and arranged
as YY/MM/DD. I need to get rid of the U and trailing space and have the end
result be DD/MM/YYYY keeping the time with it.

I've searched and tried many different ways including text to columns and then
tried to rejoin them in order and then format but the results never work out.

I prefer code since the column will have 20k+ rows of data.

The end result location doesn't matter, same column as original data is ultimate though.

Thanks in advance for ANY help,
Excel Workbook
ABC
1SyncTime ASyncTime B
2U 11/05/09 13:42:46.316549End result >>09/05/2011 13:42:46.316549
3U 11/05/09 13:42:46.316549End result >>09/05/2011 13:43:41.316549
4U 11/05/09 13:43:41.369082End result >>09/05/2011 13:43:41.369082
5U 11/05/09 13:43:41.369085End result >>09/05/2011 13:43:41.369085
6U 11/05/09 13:45:01.291638End result >>09/05/2011 13:45:01.291638
7U 11/05/09 13:45:01.291638End result >>09/05/2011 13:45:01.291638
8
9Column is formatted as TEXTColumn is formatted as TEXT
10IS > YY/MM/DDNEED > DD/MM/YYYY
11
testing
Excel 2003

Pat
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
Code:
Sub UDTtoSomethingElse()
For Each cll In Range("A2:A7").Cells    'adjust or use the next (commented-out) line instead which acts on the selected cells
'For Each cll In Selection.Cells
    zz = Split(Application.Trim(cll.Value), " ")
    mydate = Split(zz(1), "/")
    mystr = mydate(2) & "/" & mydate(1) & "/" & "20" & mydate(0) & " " & zz(2)
    cll.Offset(, 2).Value = mystr    'or to update in situ use next commented-out line instead:
    'cll.Value = mystr
Next cll
End Sub
 
Upvote 0
Code:
Sub UDTtoSomethingElse()
For Each cll In Range("A2:A7").Cells    'adjust or use the next (commented-out) line instead which acts on the selected cells
'For Each cll In Selection.Cells
    zz = Split(Application.Trim(cll.Value), " ")
    mydate = Split(zz(1), "/")
    mystr = mydate(2) & "/" & mydate(1) & "/" & "20" & mydate(0) & " " & zz(2)
    cll.Offset(, 2).Value = mystr    'or to update in situ use next commented-out line instead:
    'cll.Value = mystr
Next cll
End Sub

Thanks p45cal and VoG, for the fast response. I ended up using p45cal's since it
better suited the task better. I DO APPRECIATE IT.

Thanks,
Pat

You guys rule..
 
Upvote 0

Forum statistics

Threads
1,224,591
Messages
6,179,768
Members
452,940
Latest member
rootytrip

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