R
Ralf
Hope somebody can help me. I copied the lines listed below
into a macro to move the minus sign from data imported from a different
source from the tight to the left.
The macro works, however, the results are rounded and the decimals are not
taken into account. When I enter f.e. 100,23- and run the macro the result
is -100
which is not very handy since I use it a lot on journal entries.
Sub ConvertMinus()
Dim MemberCell As Range
For Each MemberCell In ActiveSheet.UsedRange
If Right(MemberCell.Formula, 1) = "-" Then
MemberCell.Formula = _
Val("-" & Val(Left(MemberCell.Formula,
Len(MemberCell.Formula) - 1))) 'Formula for moving sign
MemberCell.NumberFormat = "#,##0.00_);-#,##0.00" 'Controls
number format
Else
End If
Next
End Sub
Thanks in advance.
Ralf
into a macro to move the minus sign from data imported from a different
source from the tight to the left.
The macro works, however, the results are rounded and the decimals are not
taken into account. When I enter f.e. 100,23- and run the macro the result
is -100
which is not very handy since I use it a lot on journal entries.
Sub ConvertMinus()
Dim MemberCell As Range
For Each MemberCell In ActiveSheet.UsedRange
If Right(MemberCell.Formula, 1) = "-" Then
MemberCell.Formula = _
Val("-" & Val(Left(MemberCell.Formula,
Len(MemberCell.Formula) - 1))) 'Formula for moving sign
MemberCell.NumberFormat = "#,##0.00_);-#,##0.00" 'Controls
number format
Else
End If
Next
End Sub
Thanks in advance.
Ralf