I am surprised that it changes the justification but to overcome it just add
the following line of code and reset the justification.
Target.HorizontalAlignment = xlCenter
--
Regards,
OssieMac
"(E-Mail Removed)" wrote:
> Below is a snippet of code which puts a : in a number in the cell and
> it works great. My problem is that when it does this it changes the
> cell justification from Centered to Left justifed. Any way around
> this?
>
> If Target.Count=1 And Not Application.Intersect(_
> Me.Range("E3:G87"), Target) Is Nothing Then
> Application.EnableEvents=False
> If IsNumeric(Target.Value) And InStr(Target.Value, ":")=0_
> And Len(Target.Value) <5 Then
> Target.Value=Format$(Target.Value, "00\:00")
>
|