Ich möchte per Makro den Bereich C5:C9 bei einer Eingabe automatisch formatieren. Mit dem aufgeführten Makro funktioniert das zwar, jedoch nur wenn nach der Eingabe der Zahl die Enter Taste gedrückt wird. Was muss ich ändern, damit das in jedem Fall (Enter, auf-, ab-, links-, rechts-Tasten) funktioniert.
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 3 And (Target.Row > 4 And Target.Row < 10) Then
If ActiveCell.Value >= 0.1 Then Selection.NumberFormat = "0.00000"
If ActiveCell.Value >= 1 Then Selection.NumberFormat = "0.0000"
If ActiveCell.Value >= 10 Then Selection.NumberFormat = "00.000"
If ActiveCell.Value >= 100 Then Selection.NumberFormat = "000.00"
If ActiveCell.Value >= 1000 Then Selection.NumberFormat = "0000.0"
If ActiveCell.Value >= 10000 Then Selection.NumberFormat = "00000.0"
End If
End Sub
Zum Voraus besten Dank für eventuelle Tipps
Gruss Beat