adding a hyphen

L

Larry

Hi,

I have a thousand addresses, some e.g. 12345 main street.
Is there a way to automatically add a hyphen so it will be
123-45 main street.

Thanks for your help.

Larry
 
B

Bob Phillips

Larry,

In VBA it should be quite simple, but it needs some criteria.

What is the rule that determines where to place the hyphen?
 
C

CLR

To do specifically what you ask.......insert a helper column just to the
right of your addresses.......say your addresses are in column A, and
column B is the helper column.......insert this formula in B1 :
=left(A1,3)&"-"&mid(a1,4,99) and copy it down column D as far as you
need......
Then you can highlight column D and do Copy > Paste Special > Values to get
rid of the formulas, and delete the old info in column A if you
wish............


Vaya con Dios,
Chuck, CABGx3
 

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