Date Format

VbaHell

Well-known Member
Joined
Jan 30, 2011
Messages
1,220
Hello All, I am using Excel 2007 and require Help Please.
I import a report into a Tab called "MIS - Customer Invoice" which populates column "A:AO" First Row being the Header.
Column "E" is a date which is a Text Date with 2 digit year (Excel shows the same Triangle error)
The problem I have is Excel is not consistant with this date. When I try to format this some of the dates come out wrong IE: 12/1/2012 0r 1/12/2012
I have tried various way to solve this but I really just guessing.
I have also added another column "AP" to reformat the date just to show "mmm yy" which is used for loads of calcs.

Any ideas please on how to solve this first date issue

Sub UpdateData()
Dim LR As Long
Dim LC As Long
LR = Range("A" & Rows.Count).End(xlUp).Row
LC = Cells(3, Columns.Count).End(xlToLeft).Column
Sheets("MIS - Customer Invoice").Select
Columns("E:E").Select
Selection.TextToColumns Destination:=Range("E1"), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, _
Semicolon:=False, Comma:=False, Space:=False, Other:=False, FieldInfo _
:=Array(1, 4), TrailingMinusNumbers:=True


With Range("AP2:AP" & LR)
.FormulaR1C1 = "=TEXT(RC[-37],""mmm yy"")"
'.Value = .Value

End With
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
Try this:

.FormulaR1C1 = "=TRIM(TEXT(RC[-37]),""mmm yy"")"
 
Upvote 0

Forum statistics

Threads
1,203,428
Messages
6,055,325
Members
444,780
Latest member
jtfish

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