PC Review


Reply
Thread Tools Rate Thread

display leading zeros in telephone number

 
 
Andy
Guest
Posts: n/a
 
      14th Jan 2004
When I paste a list of telephone numbers, any leading
zeros are not displayed. (eg. 0944.. shows as 944...) How
can I display them corectly?

Thanks
Andy
 
Reply With Quote
 
 
 
 
Paul
Guest
Posts: n/a
 
      14th Jan 2004
"Andy" <(E-Mail Removed)> wrote in message
news:08a701c3da94$2dd89710$(E-Mail Removed)...
> When I paste a list of telephone numbers, any leading
> zeros are not displayed. (eg. 0944.. shows as 944...) How
> can I display them corectly?
>
> Thanks
> Andy


Format the cells as text before pasting the data.


 
Reply With Quote
 
Guest
Posts: n/a
 
      14th Jan 2004

>-----Original Message-----
>"Andy" <(E-Mail Removed)> wrote in

message
>news:08a701c3da94$2dd89710$(E-Mail Removed)...
>> When I paste a list of telephone numbers, any leading
>> zeros are not displayed. (eg. 0944.. shows as 944...)

How
>> can I display them corectly?
>>
>> Thanks
>> Andy

>
>Format the cells as text before pasting the data.
>


Hi Paul
Unfortunately it doesn't work since the original data is
in html format and when pasting, Excel defaults back to
number format. If I change the format back to text after
pasting, then the zeros are 'lost'. If I choose "paste
special" and paste as text, then all the data is pasted to
one column.
Andy
 
Reply With Quote
 
David McRitchie
Guest
Posts: n/a
 
      14th Jan 2004
and to fix your existing numbers to convert them to text
with a macro
you might take a look at FixUSzip5 and adapt that
to your flavor of telephone numbers (if they are consistent)
http://www.mvps.org/dmcritchie/excel/join.htm#fixUSzip5

If you can't adapt that macro yourself you would have to specify
what the actual phone numbers look like and how they are
formatted under Format, cells, number, custom

Instructions to install and use a macro on my getstarted.htm page.
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"Paul" <none> wrote in message news:(E-Mail Removed)...
> "Andy" <(E-Mail Removed)> wrote in message
> news:08a701c3da94$2dd89710$(E-Mail Removed)...
> > When I paste a list of telephone numbers, any leading
> > zeros are not displayed. (eg. 0944.. shows as 944...) How
> > can I display them corectly?
> >
> > Thanks
> > Andy

>
> Format the cells as text before pasting the data.
>
>



 
Reply With Quote
 
David McRitchie
Guest
Posts: n/a
 
      14th Jan 2004
If I copy and paste from HTML, I will get text entries for
"numbers" beginning with zero as Text without the zeros
being stripped off. So it would seem that the HTML that your
are reading from was generated from an Excel spreadsheet
and that they were numbers in the original Excel worksheets
-- in other words you have "round tripping" code in your HTML.

What I posted before still applies. I did not realize that 4 digits
was the entire phone number. You can use a custom format
of 0000 and you could then use the code I mentioned before
changing 5 to 4 and 00000 to 0000
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

<(E-Mail Removed)> wrote in message news:0a3c01c3da97$84abe300$(E-Mail Removed)...
>
> >-----Original Message-----
> >"Andy" <(E-Mail Removed)> wrote in

> message
> >news:08a701c3da94$2dd89710$(E-Mail Removed)...
> >> When I paste a list of telephone numbers, any leading
> >> zeros are not displayed. (eg. 0944.. shows as 944...)

> How
> >> can I display them corectly?
> >>
> >> Thanks
> >> Andy

> >
> >Format the cells as text before pasting the data.
> >

>
> Hi Paul
> Unfortunately it doesn't work since the original data is
> in html format and when pasting, Excel defaults back to
> number format. If I change the format back to text after
> pasting, then the zeros are 'lost'. If I choose "paste
> special" and paste as text, then all the data is pasted to
> one column.
> Andy



 
Reply With Quote
 
bob
Guest
Posts: n/a
 
      14th Jan 2004

"Andy" <(E-Mail Removed)> wrote in message
news:08a701c3da94$2dd89710$(E-Mail Removed)...
> When I paste a list of telephone numbers, any leading
> zeros are not displayed. (eg. 0944.. shows as 944...) How
> can I display them corectly?
>
> Thanks
> Andy


Another suggestion...

I copied my phone number from my website, which is in HTML, and pasted it
into Excel.
The numbers displayed as a phone number with all zeros in place.
My cell formatting isn't text; it's "general".

Also, if you want a quick way to strip away HTML, or any formatting for that
matter, copy
the material in question, then paste it into notepad. The formatting won't
be included with
the text or phone number.

First, though, I'd make sure your cell format is "general". Newer versions
of Office know how
to play well with HTML.

Feedback would be cool...

Best Regards,
bob


 
Reply With Quote
 
David McRitchie
Guest
Posts: n/a
 
      14th Jan 2004
He didn't have HTML formatting if he pasted and got numbers.
but that technique may still be of use for his problem.

Another technique to get rid of leading and trailing spaces
after converting the non breaking space character (&nbsp
to spaces is TrimALL in
http://www.mvps.org/dmcritchie/excel/join.htm#trimall

---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"bob @cssalert.com>" <expert> wrote in message news:W3bNb.47957$Rc4.198575@attbi_s54...
>
> "Andy" <(E-Mail Removed)> wrote in message
> news:08a701c3da94$2dd89710$(E-Mail Removed)...
> > When I paste a list of telephone numbers, any leading
> > zeros are not displayed. (eg. 0944.. shows as 944...) How
> > can I display them corectly?
> >
> > Thanks
> > Andy

>
> Another suggestion...
>
> I copied my phone number from my website, which is in HTML, and pasted it
> into Excel.
> The numbers displayed as a phone number with all zeros in place.
> My cell formatting isn't text; it's "general".
>
> Also, if you want a quick way to strip away HTML, or any formatting for that
> matter, copy
> the material in question, then paste it into notepad. The formatting won't
> be included with
> the text or phone number.
>
> First, though, I'd make sure your cell format is "general". Newer versions
> of Office know how
> to play well with HTML.
>
> Feedback would be cool...
>
> Best Regards,
> bob
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I display leading zeros? 5551scj Microsoft Excel Setup 1 25th Sep 2009 05:45 PM
Need 7 digit number with differnt number of leading zeros malycom Microsoft Excel Misc 10 30th Jul 2009 04:02 PM
putting zeros to certain number of leading bits in a number in VB =?Utf-8?B?Q2hlcmlmIERpYWxsbw==?= Microsoft Dot NET Framework 3 13th Jan 2006 07:57 AM
Number with leading zeros SteveM Microsoft Excel Worksheet Functions 3 2nd Feb 2004 04:47 PM
Add leading Zeros to number jack Microsoft VB .NET 5 1st Sep 2003 01:01 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:37 PM.