adding a character to all cells in one column

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? :/
 
F

Frank Kabel

Hi
in a helper column enter a formula like
=LEFT(A1,LEN(A1-1) & "-" & RIGHT(A1,1)
 
D

Don Guillett

try
Sub adddash()
For Each c In Selection
c.Value = Left(c, Len(c) - 1) & "-" & Right(c, 1)
Next
End Sub
 
R

Ron Rosenfeld

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top