SMS Marketing and Robocalls

How-To: Automatically Remove Hyphens from an Excel (*.CSV) Phone Number List

3 views October 9, 2016 January 29, 2017 lenibbs 2

  1. Highlight the column that contains the hyphens
  2. Press and hold ALT + F11 to open Microsoft Visual Basic in Excel
  3. Select “Insert” then “Module,” and paste the following visual basic script in the window:
1

2

3

4

5

6

7

8

9

10

11

12

13

14

15
Sub DeleteDashes()

'Update 20130907

Dim rng As Range

Dim WorkRng As Range

On Error Resume Next

xTitleId = "KutoolsforExcel"

Set WorkRng = Application.Selection

Set WorkRng = Application.InputBox("Range", xTitleId, WorkRng.Address, Type:=8)

Application.ScreenUpdating = False

For Each rng In WorkRng

rng.NumberFormat = "@"

rng.Value = VBA.Replace(rng.Value, "-", "")

Next

Application.ScreenUpdating = True

End Sub
  1. Press F5 to execute the script, and click on “Ok” to confirm the data range

This tip is excellent for data cleaning in preparation for use with SMS or robocall services. Note that some SMS and robocall services require data with a country code (“+1” in the US) and without parentheses or hyphens.

Was this helpful?