Converting Dates to dd/mm/yyyy

howard

Well-known Member
Joined
Jun 26, 2006
Messages
6,561
Office Version
  1. 2021
Platform
  1. Windows
I have data that is imported and need to convert that dates to dd/mm/yyyy format. As can be seen some of the ageing is negative and cannot be negative

I have used the following macro, to connvert the dates so that the ageing is correct, but cannot get it right


It would be appreciated if someone could kindly assist me in resolving this



Code:
 Sub TextToDMY()
    
    With Sheets("Imported Data")
        With Range("T2:T" & .Cells(Rows.Count, "T").End(xlUp).Row)
                            .TextToColumns Destination:=.Cells(1), _
                DataType:=1, TextQualifier:=1, _
                ConsecutiveDelimiter:=False, Tab:=True, _
                Semicolon:=False, Comma:=False, _
                Space:=False, Other:=False, FieldInfo:=Array(1, 4), _
                TrailingMinusNumbers:=True
        End With
      End With

End Sub



Excel 2010
TUVWXYZAAABACADAEAFAG
1Date ProcessedTotal Invoice ValueTotal VAT ValueOutstandingStatusNarrative Created ByNarrativeAgeing16/06/2015 10:37
225/02/2015 00:00:00-10.99070-10.9907Unpaid111
325/02/2015 00:00:00-49.08670-49.0867Unpaid111
425/02/2015 00:00:00-40.69330-40.6933Unpaid111
525/02/2015 00:00:00-40.69330-40.6933Unpaid111
625/02/2015 00:00:00-108.6470-108.647Unpaid111
725/02/2015 00:00:00-108.6470-108.647Unpaid111
825/02/2015 00:00:00-8.333330-8.33333Unpaid111
903/10/2015 00:00-71.6660-71.666Unpaid(109)
1003/10/2015 00:00-13.39070-13.3907Unpaid(109)
11
Sheet1
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
better to fix from your data source. Excel is just a whole number from 1901 forward if you can output 01 jan 2015 then it should always be right
 
Upvote 0

Forum statistics

Threads
1,213,531
Messages
6,114,172
Members
448,554
Latest member
Gleisner2

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