Gruppe
Allgemein
Problem
Die Zeichenfolgen aus dem Bereich B4:B10 sollen unter Berücksichtigung der Minuszeichen in Werte umgewandelt werden.
StandardModule: Modul1
Sub GetMinus()
Dim wks As Worksheet
Dim rng As Range
For Each wks In Worksheets
Cells.Replace ".", "µ"
Cells.Replace ",", "."
Cells.Replace "µ", ","
For Each rng In wks.UsedRange
If Not IsEmpty(rng) Then
If IsNumeric(Left(rng.Value, Len(rng.Value) - 1)) And _
Right(rng.Value, 1) = "-" Then
rng.Formula = "-" & _
WorksheetFunction.Substitute(rng.Value, "-", "")
End If
End If
Next rng
Next wks
MsgBox "Job erledigt!"
End Sub