adding a character to all cells in one column

  • Thread starter Thread starter winifred
  • Start date Start date
W

winifred

I have a column full of number like this:
2985936
234562
69863

What I need to do is add a '-' between the last and the second last
character, like this.
298593-6

Does anyone have suggestions about how to do this? :/
 
try
Sub adddash()
For Each c In Selection
c.Value = Left(c, Len(c) - 1) & "-" & Right(c, 1)
Next
End Sub
 
I have a column full of number like this:
2985936
234562
69863

What I need to do is add a '-' between the last and the second last
character, like this.
298593-6

Does anyone have suggestions about how to do this? :/

You could use the custom format 0-0.
Format/Cells/Number Custom Type: 0-0

Or, if you wanted to convert the number to text:

=TEXT(A1,"0-0")


--ron
 
Back
Top