Formula to Macro help PLEASE

H

Hemming

I have a column of telephone numbers. I need to change the area code and
first three digits of each of these numbers to a new area code and new
first thee digits. Example: 5555555555 change to (444)444-5555. notice
the last four digits need to stay the same.
If I have 100 numbers to change, the last 4 digits will be 100 unique
numbers. The formula =value(“444444”&right(a1:a100,4)) works however I
need to do this as part of a Macro ( for ease to the person using the
spreadsheet ) need some help PLEASE !!! thanks
 
G

Guest

Enter this macro:

Sub Macro1()
Dim r As Range
Dim s1 As String
Dim s3 As String
s3 = "(444)444-"
For Each r In Selection
s1 = r.Value
r.Value = s3 & Right(s1, 4)
Next
End Sub

Then on the worksheet, select the cells you want to convert and run the macro
 
D

Dave Peterson

You have other suggestions at your other posts.
I have a column of telephone numbers. I need to change the area code and
first three digits of each of these numbers to a new area code and new
first thee digits. Example: 5555555555 change to (444)444-5555. notice
the last four digits need to stay the same.
If I have 100 numbers to change, the last 4 digits will be 100 unique
numbers. The formula =value(“444444”&right(a1:a100,4)) works however I
need to do this as part of a Macro ( for ease to the person using the
spreadsheet ) need some help PLEASE !!! thanks
 

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