hi,
tried both but it gives an error
the code is in a module in the "PERSONAL.XLSB"
Sub SELECTION_TO_AMOUNT()
For Each xCell In Selection
Selection.Replace What:="s", Replacement:="5", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Selection.Replace What:="-", Replacement:="0", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
If Mid(Right(cell.Value, 2), 1, 1) = "," Or Mid(Right(cell.Value, 3), 1, 1) = "," Then
cell.Select
Selection.Replace What:=",", Replacement:=".", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
End If
Selection.NumberFormat = "#,##0.00" 'Note: The "0.00" determines the number of decimal places.
xCell.Value = xCell.Value
Next xCell
End Sub
Sub SELECTION_TO_AMOUNT()
For Each xCell In Selection
Selection.Replace What:="s", Replacement:="5", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Selection.Replace What:="-", Replacement:="0", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
With cell
If Right(.Value, 2) = "," Or Right(.Value, 3) = "," Then .Value = Replace(.Value, ",", ".")
End With
Selection.NumberFormat = "#,##0.00" 'Note: The "0.00" determines the number of decimal places.
xCell.Value = xCell.Value
Next xCell
End Sub
Bookmarks