Excel 97 customised toolbar, UK date format errors .. ?
Posted by Aid Burrow on April 10, 2001 7:14 AM
Help!
I am running Excel 97 [ver SR-2(k)] on Windows 98 SE.
UK short date in Regional Settings is dd/MM/yyyy.
I am importing a CSV file into Excel where date is in format "dd/mm/yy", ie: 12th April 2001 = "12/04/01"
I have recorded / modified a macro which (amongst other things) formats the date column as below ...
Columns("H:H").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.ShrinkToFit = False
.MergeCells = False
.NumberFormat = "dd/mm/yyyy"
End With
... and then saves the file as .xls.
If I run the macro from the standard toolbar (ie: Tools/Macro/Macros/) then everything works just great,
ie: CSV format "12/04/01" and "17/04/01" comes across as 12/04/2001 and 17/04/2001 respectively ... However:
If I run the same macro from a customised toolbar, the results are ... 04/12/2001 and 17/04/01 respectively.
A hell of a shame as customised toolbars are a handy facility for farming out files to users. Anyone know a way round this?