user793468
user793468

Reputation: 4966

format cell values to phone number format

I have phone numbers listed in Column A of Sheet1. Currently they dont have any format and are stored as: 1112223333

I want to convert them to: 111.222.3333

I tried:

Format(Worksheets("Sheet1").Range("A1").Value, "###.###.####")

which gives me "1112223333.."

EDIT: When I try to format it to:

Format(Worksheets("Sheet1").Range("A1").Value, "(###) ###-####")

It works perfectly fine: (111) 222-3333

Its just with the "111.222.3333" format that I am having issues with. Am I missing something here?

Thanks in advance

Upvotes: 3

Views: 8898

Answers (1)

Doug Glancy
Doug Glancy

Reputation: 27478

The periods need to be converted to text, otherwise they're read as decimal points:

Worksheets("Sheet1").Range("A1").NumberFormat = "###"".""###"".""####"

Upvotes: 6

Related Questions