Hallo Paul

geerkens schrieb:
Hallo Leute ,

also zunächst mal lasse ich die Förmlichkeiten weg. Ist wohl hier weniger
angebracht.
Zur Sache:
Das diese Art der Eingabe so neu für Euch alle zu sein scheint ist schon
seltsam. In unserem Berufszweig ist diese Art der Zahleneingabe durchaus
normal und üblich (und wenn man sich daran gewöhnt hat auch fast nicht mehr
abzugewöhnen).
Die Formatierungsvorschläge 0","00  bzw. #","## funktionieren ganz gut
bezüglich der Kommastelle. Allerdings bekomme ich dann Probleme bei dem
Tausendertrennpunkt. Mit Formatierung #.##0","00 sehen die Zahlen dann so
aus: 1.234.5,67 weil immer die Formatierung #.###.0","00 daraus wird. Ein
Makro wäre für mich die letzte Lösung.
Du scheinst zwar nicht viel von Makros zu halten, (meine letzte angebotene Lösung war auch nicht das Gelbe vom Ei), aber versuchs doch mal mit folgendem:

______________________

Sub format_festkommatest
oSelect=ThisComponent.CurrentSelection
oColumn=oselect.Columns
oRow=oSelect.Rows
For n= 0 To oColumn.getCount-1
    For m = 0 To oRow.getCount-1
        oCell=oselect.getCellByPosition (n, m)
        If oCell.NumberFormat = 0  Then
            eintrag = oCell.String
             If Len(eintrag) = 9 Then
            links = Left(eintrag, 7)
            rechts = Right(eintrag, 2)
            neu_eintrag = links & "," & rechts
            oCell.String = ""
            oCell.NumberFormat = 2
            oCell.FormulaLocal = neu_eintrag
            End If

            If Len(eintrag) = 8 Then
            links = Left(eintrag, 6)
            rechts = Right(eintrag, 2)
            neu_eintrag = links & "," & rechts
            oCell.String = ""
            oCell.NumberFormat = 2
            oCell.FormulaLocal = neu_eintrag
            End If

            If Len(eintrag) = 7 Then
            links = Left(eintrag, 5)
            rechts = Right(eintrag, 2)
            neu_eintrag = links & "," & rechts
            oCell.String = ""
            oCell.NumberFormat = 2
            oCell.FormulaLocal = neu_eintrag
            End If
             If Len(eintrag) = 6 Then
            links = Left(eintrag, 4)
            rechts = Right(eintrag, 2)
            neu_eintrag = links & "," & rechts
            oCell.String = ""
            oCell.NumberFormat = 2
            oCell.FormulaLocal = neu_eintrag
            End If
             If Len(eintrag) = 5 Then
            links = Left(eintrag, 3)
            rechts = Right(eintrag, 2)
            neu_eintrag = links & "," & rechts
            oCell.String = ""
            oCell.NumberFormat = 2
            oCell.FormulaLocal = neu_eintrag
            End If
             If Len(eintrag) = 4 Then
            links = Left(eintrag, 2)
            rechts = Right(eintrag, 2)
            neu_eintrag = links & "," & rechts
            oCell.String = ""
            oCell.NumberFormat = 2
            oCell.FormulaLocal = neu_eintrag
            End If
             If Len(eintrag) = 3 Then
            links = Left(eintrag, 1)
            rechts = Right(eintrag, 2)
            neu_eintrag = links & "," & rechts
            oCell.String = ""
            oCell.NumberFormat = 2
            oCell.FormulaLocal = neu_eintrag
            End If
              If Len(eintrag) = 2 Then
           'links = Left(eintrag, 2)
            rechts = Right(eintrag, 2)
            neu_eintrag = "0," & rechts
            oCell.String = ""
            oCell.NumberFormat = 2
            oCell.FormulaLocal = neu_eintrag
            End If
        End If
    Next m
Next n
End Sub


_______________

Es konvertiert 2- 9stellige Zahlen in markierten Zellbereichen in "richtige" Zahlen mit 2 Kommastellen.

Gruß
Werner

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Antwort per Email an