Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 144
Default Format cells in web query (leading zeroes)

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.

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 75
Default Format cells in web query (leading zeroes)

Try formatting your phone field column as text before you import.

"Kathy" wrote in message
...
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.



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default Format cells in web query (leading zeroes)

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

"Kathy" wrote:

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.

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 144
Default Format cells in web query (leading zeroes)

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

"Wondering" wrote:

Try formatting your phone field column as text before you import.

"Kathy" wrote in message
...
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.




  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 144
Default Format cells in web query (leading zeroes)

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.

"IndianSummer" wrote:

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

"Kathy" wrote:

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.



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default Format cells in web query (leading zeroes)

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?

"Kathy" wrote:

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.

"IndianSummer" wrote:

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

"Kathy" wrote:

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.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sorry, leading zeroes again :-(( Argghhhh Excel Discussion (Misc queries) 7 November 13th 06 10:26 PM
Leading Zeroes Ken Excel Discussion (Misc queries) 1 October 7th 05 03:17 PM
how to keep leading zeroes when saving in xls in csv format Joe Excel Discussion (Misc queries) 2 October 5th 05 06:42 PM
CSV leading zeroes Tim_nol Excel Discussion (Misc queries) 2 December 28th 04 08:19 PM
How do I format data cells in Excel to keep leading zeroes? LennyD Setting up and Configuration of Excel 2 December 15th 04 10:42 PM


All times are GMT +1. The time now is 09:38 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"