Can anyone help me amend this snippet to instead of adding periods to break up a phone number to replacing the first four digits with an "x"?
Thanks,
J
Thanks,
J
Code:
Sub SymbolsInPhN()
Dim rRng As Range, rCell As Range
Set rRng = Range("A2", Range("A" & Rows.Count).End(xlUp))
With CreateObject("vbscript.regexp")
.Pattern = "(\d{3})(\d{3})(\d{4})"
.Global = True
For Each rCell In rRng
If rCell.Value <> "" Then _
rCell.Value = .Replace(rCell.Value, "$1.$2.$3")
Next rCell
End With
End Sub