phone numbers

B

bylsma

Hi I'm stuck on this one I want to add a 1 to my phone list. I have
removed all spaces and other signs to create a number such as from
(201) 276-2143 to 2012762143 Now I need to add a 1 to the whole column
of about 52,000.
to make it 12012762143, and of course add the 1 to all the numbers in
the column individually. Then change all this to a CSV file I can
upload . Whew!
Is there anyone out there who can help!! Thanks bylsma
 
P

Paul B

bylsma, here is one way,

Sub Add_1()
'will add 1 in front of what's in the used range in column A
Set rng = Intersect(Range("A:A"), ActiveSheet.UsedRange)
For Each c In rng
c.Value = "1" & c
Next
End Sub

To put in this macro, from your workbook right-click the workbook's icon and
pick View Code. This icon is to the left of the "File" menu this will open
the VBA editor, in Project Explorer click on your workbook name, if you
don't see it press CTRL + r to open the Project Explorer, then go to insert,
module, and paste the code in the window that opens on the right hand side,
press Alt and Q to close this window and go back to your workbook and press
alt and F8, this will bring up a box to pick the Macro from, click on the
Macro name to run it. If you are using excel 2000 or newer you may have to
change the macro security settings to get the macro to run. To change the
security settings go to tools, macro, security, security level and set it to
medium

--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003
 
C

CLR

Assuming your list is in Column A, you can CONCATENATE the 1 in by putting
this formula in B1 and copying down, then Copy > PasteSpecial > Values on
column B and delete column A if you wish.....

=1&A1

Vaya con Dios,
Chuck, CABGx3


Paul B said:
bylsma, here is one way,

Sub Add_1()
'will add 1 in front of what's in the used range in column A
Set rng = Intersect(Range("A:A"), ActiveSheet.UsedRange)
For Each c In rng
c.Value = "1" & c
Next
End Sub

To put in this macro, from your workbook right-click the workbook's icon and
pick View Code. This icon is to the left of the "File" menu this will open
the VBA editor, in Project Explorer click on your workbook name, if you
don't see it press CTRL + r to open the Project Explorer, then go to insert,
module, and paste the code in the window that opens on the right hand side,
press Alt and Q to close this window and go back to your workbook and press
alt and F8, this will bring up a box to pick the Macro from, click on the
Macro name to run it. If you are using excel 2000 or newer you may have to
change the macro security settings to get the macro to run. To change the
security settings go to tools, macro, security, security level and set it to
medium

--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003
 

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