You could use a worksheet_change event, assuming these are manual entries:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim MonitoredRange As Range
' change as required
Set MonitoredRange = Range("A1:B5")
If Not Intersect(Target, MonitoredRange) Is Nothing Then
Application.ScreenUpdating = False
Dim cell As Range
For Each cell In Intersect(Target, MonitoredRange).Cells
If IsNumeric(cell.Value2) Then
With cell
.HorizontalAlignment = xlCenter
.ShrinkToFit = True
End With
Else
With cell
.HorizontalAlignment = xlLeft
.ShrinkToFit = False
End With
End If
Next cell
End If
End Sub
Bookmarks