Cleaning Up Phone Numbers With VBA
Aug 31, 2007
I am using VBA to enter customer information into a Microsoft SQL database. I have an excel sheet with thousands of customers listed. I will be using a While loop to process each line of the sheet. Part of the While loop needs to make any format changes necessary before the data moves over to the DB. So here is the issue:
How do I turn the following phone numbers:
(410) 273-9200
910-944-1232
276 623 4254
410 612 1100 Rob
(413) 786-1636 Cindy
1-800-783-4661
304) 842-5491 Sherry
Into a uniform layout? I would prefer ###-###-####
Each of the numbers above is an example from the list I have. There may be more variations (I have over 20 seperate lists to process, with over 10000 customers per list)
I imagine I need some process that will remove all character except numbers and then break the numbers up to add the hyphens back in at the appropriate places.
View 10 Replies
ADVERTISEMENT
Jun 22, 2014
I have an old customer list maintained by my company's previous owner in excel format that mostly stored numbers ###-#### format, but also some in ###-###-#### format.
My new list has always been maintained with numbers in (###) ###-#### format.
I have merged these two lists in a new excel file have begun the tedious process of cleaning up duplicates and bad data.
I have used conditional formatting to highlight duplicate numbers in the appropriate columns (L, M, N, O) in this case. However, it does't find matches in the other formats or perhaps the number with the old area code. I know the area code change could lead to false positives, but they should be minimal as this is a small business with mostly local customers. So what I'd like to find out is a formula for conditional formatting that will compare the last 8 characters in each cell (###-####) so as to eliminate issues of missing or different area codes. I would like it to check all of the columns for duplicate numbers not just within each column or within each row individually.
Also separate but related if possible to highlight a different color any cells with data not in any of these formats or if not in (###) ###-#### format if it's too much for all the formats.
View 8 Replies
View Related
Dec 8, 2009
I have a bunch of phone numbers that I'm trying to reformat.
Say I wanted to replace any phone number like this: 1##########
With this: ##########
Keeping the numbers intact, just getting rid of the 1 in front of them. Can't figure it out for the life of me.
View 6 Replies
View Related
Feb 1, 2010
Just got an answer to my phone number problem of converting two columns of numbers
to a single columns with the form XXX-XXXXXXX. Used =A1 & "-" & B1.
Works perfectly one one spread sheet and not at all in another.
When I enter the formula and hit return, instead of the correct result, all I get is the formula.
The format of the columns is the same on both spread sheets.
View 4 Replies
View Related
Apr 25, 2013
Formatting existing phone number. I want to remove first 2 digit from the column with 11 digit phone number ?
View 1 Replies
View Related
Sep 17, 2009
I came up with this formula trying to fix phone number but it’s not working properly
FORMULA:
=TEXT(LEFT(SUBSTITUTE(a1, "-", "") & "00##", 10), "###-###-00##")
So basically I need a formula or macro that will fix the phone number for me.
Here is an example
78512312 it should be like this 785-123-0012
Or
785123123 it should be like this 785-123-0123. So if Len is 8 numbers long then insert two zeros counting from right to left. So if Len is 9 numbers long then insert one zeros counting from right to left.
View 2 Replies
View Related
May 20, 2012
I have thousands of phone numbers that hundreds of them are look like this:
123456-8 that means : 123456,123457,123458 or this
123456-57 that means : 123456,123457
There are not any standard of numbers after dash (-) in my data.
how can I expand them to new "rows"?
bob 123456-8 ->
bob 123456
bob 123457
bob 123458
View 9 Replies
View Related
Aug 25, 2013
I'm trying to simplified these numbers so each one only consists 8 numbers from the right w/out the blank space or +,-.
Tracking Number
Recip Phone
495905380312
(65)96502898
304612528629
6598941713
495905380746
+6596813956
486044711528
+65 9459 5540
409709299705
6750 2518
409720592221
65-6381-3351
427249160171
6581233832
View 3 Replies
View Related
May 15, 2007
How do i go about importing contacts - names, numbers, addresses that are in excel into Microsoft Outlook?
View 2 Replies
View Related
Sep 5, 2007
I have an excel spreadsheet listing some company contacts i need to improve. At the moment the companies address and telephone number are in the same field c2 all the way down to c2120. I need to take the telephone and fax data out of the field and into column d for all the entries. The phone and fax details are in the cells as follows ....
View 9 Replies
View Related
Oct 23, 2007
I'm trying to format some cells, its some phone numbers but not in the traditional format (###) ###-####.
I need to get them to appear like this ###.###.####,
View 4 Replies
View Related
Sep 22, 2009
I have a column full of 10 digit pone numbers. All different numbers and many different area codes (No dashes):
Example:
3305555555
4583651586
4128563254
Is there a way to remove the three leading numbers from all of the numbers at once for the whole column?
View 2 Replies
View Related
Dec 5, 2008
I have a list of mobile phone numbers from various countries. However, I do not know which country each entry is from. Ideally I would like to have a macro that looks at each number, compares to a global list of PSTN structure to determine which part of the phone number is the country code (generally the first 1-3 digits), and then put the country in a separate column.
I am certain all numbers are formatted correctly, so it is only a matter of finding out which part is the country code and putting a value for the country.
View 9 Replies
View Related
Oct 24, 2007
How can I use the RAND function to generate a list of simulated phone numbers.
View 9 Replies
View Related
Oct 22, 2008
I'm trying to change a
418,3315555
format cell to a regular phone number cell
418-331-5555
View 9 Replies
View Related
Dec 5, 2008
I have a list of mobile phone numbers from various countries. However, I do not know which country each entry is from. Ideally I would like to have a macro that looks at each number, compares to a global list of PSTN structure to determine which part of the phone number is the country code (generally the first 1-3 digits), and then put the country in a separate column.
I am certain all numbers are formatted correctly, so it is only a matter of finding out which part is the country code and putting a value for the country.
View 9 Replies
View Related
Apr 21, 2009
I have a large list of phone numbers & some of the numbers do not have area codes. The area code is the same for all numbers. Is there a way to add the area codes to all of these numbers without keying all in manually
View 9 Replies
View Related
Apr 12, 2006
How can I create a vlookup function to automatically retrieve phone numbers off switchboard.com using my current mailing list?
I have a list of more than 4,000 of my customers. I want to ad in phone numbers automatically. I currently have the first and last name in one column. The address, city, state and zip are all each in their own column.
I have never use vlookup before, nor have I ever used excel other than for data entry. What is the easiest and most efficient way to do this?
I searched this site and seen vlookup mentioned for this type of automatic data entry. There may be another way or method I am not aware of.
View 9 Replies
View Related
Dec 16, 2008
I am looking for a formula to count the number of valid mobile phone numbers in a list and the number of valid email address in another list, 2 different formulas.
The mobile phone number formula would count the number of indervidual mobile phone numbers in a list that contain 077 and 078 and 079.
The email formula would count the number of indervidual email addresses in a list that contain ...........@..........dot com or .............@............dot co dot uk
Both lists may contain random junk text, like in the email list some one may have entered words like 'no email address' etc.
View 11 Replies
View Related
Aug 28, 2012
I have several text boxes on a 'picture' which is the format for a business review. The text boxes are linked to cells behind the picture which picks up company names, cities etc...
Two of the boxes have a phone# and date
The linked cells are formatted correctly but obviously the text boxes, pick up the 'values' not the formats.
is there any way for the textboxes to show the values with the proper format i.e.,
xxx-xxx-xxxx
mmm yyyy
View 2 Replies
View Related
May 4, 2008
I have to take a range of phone numbers that I have to port from another carrier and manually type them out or copy into another speadsheet, removing duplicate numbers. For example, I have the following numbers:
55532821055553282108
78132821235553282123
55532821625553282163
The results on the next spreadsheet need to be:
5553282105
5553282106
5553282107
5553282108
7813282123
5553282162
5553282163
I am looking for a way to automate this process.
View 8 Replies
View Related
Feb 21, 2012
I have a spreadsheet with Mobile phone numbers in the following format:
+44(0)77 7296 5210
The spreadsheet has 2500 of these phone numbers.
Is there a way to remove the brackets and the +44 to leave:
07772965210
I am using Microsoft Office for Mac 2011
View 5 Replies
View Related
Mar 18, 2013
I've read a lot of tutorials on how to use pivot tables, but found them either too basic, or too advanced, and never finding any example of what I am looking to do.
I have a database, column A holds names, and column B their phone numbers. I'd like to generate a list of unique names and their associated telephone numbers. I figure I can use a pivot table to do this.
But I do not quite understand how to format the pivot table to put the name in one column and the phone number in the next. I will use this pivot table as a vlookup range. I assume I can do this.
View 7 Replies
View Related
Mar 29, 2013
I'm pulling phone numbers out of text strings. There is text string ("Office:") indicating that the number following is an office number (the number that I need). MID and FIND take care of this. There are sometimes two instances of office numbers in single text string, so adding a second column using the third argument of FIND lets me start another search past the first instance of an office number. We have a bunch of office numbers with the qualifier "(Text)" after the original "Office" but before the phone number. How do I catch these ones?
View 8 Replies
View Related
Dec 22, 2008
I am basically doing some housekeeping and trying to reduce my number of code lines.
Can this bit of code be done a bit simpler?
For r = lrow To 15 Step -1
If Range("N" & r).Interior.Color = vbRed Then
Range("N" & r).Interior.Color = vbCyan
Range("N" & r).Value = "Triangular"
End If
If Range("V" & r).Interior.Color = vbRed Then
Range("V" & r).Interior.Color = vbCyan
Range("V" & r).Value = "Triangular"
End If
Next r
View 9 Replies
View Related
Apr 15, 2007
It has been working perfectly from all sites but for some reason started to enter the wrong data once in a while?
Sub Macro8()
Application.StatusBar = "Updating Data from NOAA"
Application.DisplayAlerts = False
Application.ScreenUpdating = False
Sheets("Web Data").Select
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;http://www.srh.noaa.gov/ifps/MapClick.php?TempBox=1&HumidBox=1&Submit=Submit&FcstType=digital&textField1=32.74&textField2=-96.45&site=fwd&Radius=0&CiTemplate=0" _
, Destination:= Range("A15"))
.Name = _
"MapClick.php?TempBox=1&HumidBox=1&Submit=Submit&FcstType=digital&textField1=33.65&textField2=-95.54&site=fwd&Radius=0&CiTemplate=0_5"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False............................
View 7 Replies
View Related
Jun 24, 2008
I have a database of sales records containing 6 address columns (C-H). I want to extract the country (which may be entered in any of the 6 columns) and place this in a separate column. I have a definitive list of countries on sheet 2 which I have saved as a named range (Country).
I would like to be able to set something up which searches the six address fields on sheet 1 and if a match is found against the Country range, enter this in a separate column (I). A non-code solution would be ideal as I am nowhere near that level yet and want to be able to understand what I am doing as far as possible!
View 9 Replies
View Related
May 15, 2007
I frequently use the record option to start off my macros. I realize this usually results in recorded events which are not absolutely necessary (recording a print macro is one that is full of excess line items). I then try and combine what I have recorded with what I have garnered from this wonderful website. If my spreadsheets are small - and I am not writing code to pass any inspections - is there a need to go back and clean up?
View 2 Replies
View Related
Apr 26, 2014
However I have survey data results and in one of the cells it has multiple values which are separated between ; and some are not separated at all e.g B&Q; The Range; Wicks The Garden Shop
Also there are spelling mistakes everywhere and variation of the word B&Q e.g b+q, B n Q
I need to add count up all of the B&Q, Wicks etc...
View 7 Replies
View Related
Feb 2, 2012
I wanted to create a target workbook that is a subset of the source workbook
1) I want to specify a list of worksheets in the source workbook:
For Each WSCurrent In Sheets(Array("SheetA", "SheetB", "SheetC"))
Next WSCurrent
2) I want to them copy these sheets into another workbook (don't know how to code this)
3) I then want to hardcode all these sheets (I don't know the most efficient way to do this)
4) Lastly, I want to eliminate certain columns (can be fed through a hardcoded list of Columns to delete e.g. X, W, Z)
View 5 Replies
View Related