Removing beginning minus sign from telephone numbers

G

Guest

I have a Excel document which retrieves contact data from a server, processes
it, and creates and sends the document to a predetermined e-mail address. My
problem is that the phone numbers are in "international" format, for example
+46 0123456789... This makes Excel think that it's some kind of mathematic
formula, causing it to put a minus sign (-) before the number, making it
useless. It's possible to use find/replace to correct this, but this is not
an option for me since the whole process has to be automated. I've tried
lot's of different macros etc, but so far I haven't been able to solve this
problem. Is there some way I can tell Excel that the telephone and fax number
field should added to the document with no modifications?

Range("A1") = "Name"
Range("B1") = "Page"
Range("C1") = "Time"
Range("D1") = "DUNS number"
Range("E1") = "Company ID"
Range("F1") = "Address1"
Range("G1") = "Address2"
Range("H1") = "ZIP/postal code"
Range("I1") = "City"
Range("J1") = "Region"
Range("K1") = "Country"
Range("L1") = "Phone"
Range("M1") = "Fax"
Range("N1") = "Website"
Range("O1") = "Number of employees"
Range("P1") = "SIC code"
Range("Q1") = "SIC code text"
Range("R1") = "Sales Euro"
Range("S1") = "Year started"
Rows("1:1").Font.Bold = True
Cells.Columns.AutoFit

I'm guessing that I should modify something here, but I don't know what. All
help is appreciated!
 
D

Don Guillett

try recording a macro while you do it to see. You will get
Columns("C:C").Select
Selection.NumberFormat = "@"

modify to
Columns("C").NumberFormat = "@"
and change the column to suit

Don Guillett
SalesAid Software
(e-mail address removed)
Henrik Johnson said:
Exactly. What's the VBS command to do this, and where should it be
entered?
 

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