Formatted Number into String Variable, Excel VBA

M

mac7attack

Hello All,

I am using a script to take a list of phone numbers formatting them and
then doing a search with the phone number. I need to use the formatted
phone number to do the search.

Cell(2,3) before code is 12345678901
after code is +1 (234) 567 8901
Code Snippet:

Dim telephone as String
Columns("C:C").Select
Selection.NumberFormat = "+# (###) ### ####"
telephone = Cells(2,3).Value

End Code

The problem is that the variable "telephone" is equal to 12345678901
not the formatted +1 (234) 567 8901. Is there a way to convert the
formatted number into a string in VBA?

Excel 2003 VBA

Thanks in advanced
Matt
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top