ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How do I create a macro to put "-" between existing numbers? (https://www.excelbanter.com/excel-programming/339976-how-do-i-create-macro-put-between-existing-numbers.html)

Steverino

How do I create a macro to put "-" between existing numbers?
 
I have a spreadsheet containing Social Security numbers. All need to be in
the format ###-##-####. How do I create a macro to do this on a cell that
has the format #########?

So far what I get is that the macro changes the SS# to be the same as the
one I changed when creating the macrol.

Jim Thomlinson[_4_]

How do I create a macro to put "-" between existing numbers?
 
Why not just do it with a custom format. Select the area you want to modify
and right click. Choose Format Cells. Choose Custom. Type in 000-00-0000...
--
HTH...

Jim Thomlinson


"Steverino" wrote:

I have a spreadsheet containing Social Security numbers. All need to be in
the format ###-##-####. How do I create a macro to do this on a cell that
has the format #########?

So far what I get is that the macro changes the SS# to be the same as the
one I changed when creating the macrol.


Steverino

How do I create a macro to put "-" between existing numbers?
 
Thanks for the help. However, I am creating a spreadsheet to use as an
import to setup a database. I therefore actually need to insert the dashes.

"Jim Thomlinson" wrote:

Why not just do it with a custom format. Select the area you want to modify
and right click. Choose Format Cells. Choose Custom. Type in 000-00-0000...
--
HTH...

Jim Thomlinson


"Steverino" wrote:

I have a spreadsheet containing Social Security numbers. All need to be in
the format ###-##-####. How do I create a macro to do this on a cell that
has the format #########?

So far what I get is that the macro changes the SS# to be the same as the
one I changed when creating the macrol.



All times are GMT +1. The time now is 05:52 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com