I am working on a macro that will take a list of phone numbers from a report and strip them down to the area
code or international code. The major problems are as follows:
1) Telephone numbers are stored as strings because of how they are imported in to Excel
2) Not all telephones numbers are reported correctly. Some numbers will be reported as "Unknown", "408" or missing the last 2-4 digits. Others numbers will be only 4 digits; these are internally dialed numbers therefore digits will be changed to area code 919.
3) Most numbers will have "81" as the first two characters then the area code.
So examples of what the
cells would contain and what result of macro should be:
Type of Call Cell Value Result
External Call 819196772499 919
International Call 8011498946261990 011
Internal Call 2466 919
Only Area Code 408 408
Unknown Unknown Unknown
Is there a way to
compare the string to "Unknown"? and then
Count how many digits there are and strip digits off both sides (if needed)?
Thanks in Advance
MAC