When you enter a date with just two values, where they can be interpreted as
a day-month pair (e.g. Jan-11) Excel assumes you mean "January 11, [current
year]", not "January 2011". To avoid this in the future, you can enter the
date with the 4-digit year (since there is no 2011th day of January, Excel
picks the first day of that month).
My best suggestion would be to check the cell's .Text property, somewhat like
this:
t = ActiveCell.Text
y = InStr(InStr(ActiveCell.Text, "-") + 1, ActiveCell.Text, "-")
'if y then dd-mmm-yyyy else mmm-yy
If Not y Then t = "1-" & t
'format here using t
(But note that this code will get things wrong if it gets "11-Jan" instead of
--
Artificial by necessity.