parscon
03-28-2013, 09:51 AM
I have a VBA code that delete Dash - from end of cell now I want also delete the dash of first of my data
like :
-12121121
When run VBA code delete the first - .
also if have -12121121- when run code delete dash and will be 12121121
Sub Trim()
For Each c In Worksheets("Sheet1").Range("A1:A3").Cells
If Right(c.Value, 1) = "-" Then
c.Value = Mid(c.Value, 1, Len(c) - 1)
End If
Next
End Sub
like :
-12121121
When run VBA code delete the first - .
also if have -12121121- when run code delete dash and will be 12121121
Sub Trim()
For Each c In Worksheets("Sheet1").Range("A1:A3").Cells
If Right(c.Value, 1) = "-" Then
c.Value = Mid(c.Value, 1, Len(c) - 1)
End If
Next
End Sub