von Karolus » Di, 21.03.2006 15:19
Hallo AnZaMa
Das funktioniert auch unter Linux , allerdings nur mit Leertaste vor und hinter dem "-Zeichen,
weil es anders nicht als einzelnes Wort zu erkennen ist.
Gruß Karo
ps. Vielleicht nützt dir ein Makro , das in einem markierten Bereich zwei- bis vierstellige Zahlen durch entsprechende Zeitwerte ersetzt.
1245 -> 12:45
530 -> 05:30
45 -> 00:45
Sub format_zeit
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)
eintrag = oCell.String
If Len(eintrag) = 4 Then
links = Left(eintrag, 2)
rechts = Right(eintrag, 2)
neu_eintrag = links & ":" & rechts
oCell.String = ""
oCell.NumberFormat = 40
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 = 40
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 = 40
oCell.FormulaLocal = neu_eintrag
End If
Next m
Next n
End Sub
Hallo AnZaMa
Das funktioniert auch unter Linux , allerdings nur mit Leertaste vor und hinter dem "-Zeichen,
weil es anders nicht als einzelnes Wort zu erkennen ist.
Gruß Karo
ps. Vielleicht nützt dir ein Makro , das in einem markierten Bereich zwei- bis vierstellige Zahlen durch entsprechende Zeitwerte ersetzt.
1245 -> 12:45
530 -> 05:30
45 -> 00:45
Sub format_zeit
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)
eintrag = oCell.String
If Len(eintrag) = 4 Then
links = Left(eintrag, 2)
rechts = Right(eintrag, 2)
neu_eintrag = links & ":" & rechts
oCell.String = ""
oCell.NumberFormat = 40
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 = 40
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 = 40
oCell.FormulaLocal = neu_eintrag
End If
Next m
Next n
End Sub