Format cells in web query (leading zeroes)

G

Guest

I am trying to import an aspx page that uses a gridview control to display
data. User needs it in Excel. I do a web query and it works out, but Excel
cuts off the leading zeroes in the phone field, which is a text field in the
underlying table. I played with all the options, preserve formatting (or
not), no formatting, etc. Excel keeps changes to general and therefore
deletes the leading zeroes.
 
G

Guest

Hi Kathy,
Do you have a fixed number of digits in your phone field? If so you could
create a custom format. eg. if you setup a custom format of "000000"
(without the talking marks) your numbers will all display as a six digit
number. So even better for you would be something like this: "00 0000 0000"
which would make our (aussie) phone numbers appear as "03 9350 3456".

Hope this helps,
Helen
 
G

Guest

Phone field is text. Looks fine on the web page. Only when bringing it into
Excel does it switch.
 
G

Guest

Unfortunately, it's a 4-digit dial code. Sometimes it happens to have a
leading zero (0193) and sometimes not (8502). Thanks for the suggestion tho.
 
G

Guest

You're welcome :) But..I realise I'm not clear now on your issue - "0000" as
a custom format will cause 193 to display as 0193 and 8502 to display as
8502. Is that not what you wanted?
 

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