View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
[email protected] ordnance1@comcast.net is offline
external usenet poster
 
Posts: 4
Default Cell justifcation

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")