Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Tom
 
Posts: n/a
Default Pasting a number to Excel that begins with 0

I need to paste numbers to Excel that sometimes begin with 0. How do I do
this without losing the lead 0? I am using Office 2000. You advice is
appreciated.
  #2   Report Post  
Alan Perkins
 
Posts: n/a
Default

Tom, one way to do it:

Format the target cell(s) as Text. Then select Edit | Paste Special | Text
from the Excel menu.

HTH

Alan P.

"Tom" wrote in message
...
I need to paste numbers to Excel that sometimes begin with 0. How do I do
this without losing the lead 0? I am using Office 2000. You advice is
appreciated.



  #3   Report Post  
George Nicholson
 
Posts: n/a
Default

Set up the range you are pasting to with a Custom format that includes
leading zeros.
Copy your data. Use PasteSpecialValues to paste.

Note: the underlying contents of the cell will not actually include the
leading zero, but the leading zero will *display* as specified.
If you want to actually store the leading zero then you'd have to store it
as alpha-numeric text. Numbers don't have leading zeros (except zero
itself).

HTH,
--
George Nicholson

Remove 'Junk' from return address.


"Tom" wrote in message
...
I need to paste numbers to Excel that sometimes begin with 0. How do I do
this without losing the lead 0? I am using Office 2000. You advice is
appreciated.



  #4   Report Post  
Tom
 
Posts: n/a
Default

Alan,

The problem is that the data is being copied out of a web page that includes
multiple columns of data, if I set it to text, it does import the 0s however,
it puts all three columns of data in the same column. Any ideas on cleaning
that up?

Tom Schmitt

"Alan Perkins" wrote:

Tom, one way to do it:

Format the target cell(s) as Text. Then select Edit | Paste Special | Text
from the Excel menu.

HTH

Alan P.

"Tom" wrote in message
...
I need to paste numbers to Excel that sometimes begin with 0. How do I do
this without losing the lead 0? I am using Office 2000. You advice is
appreciated.




  #5   Report Post  
alex s via OfficeKB.com
 
Posts: n/a
Default

you could format the cell as custom and have as many zero's as you want. all
our account codes have 7 numbers, sometimes starting as 00xxxxx. format the
cell as"0000000" and you only need to input xxxxx to get 00xxxxx
George Nicholson wrote:
Set up the range you are pasting to with a Custom format that includes
leading zeros.
Copy your data. Use PasteSpecialValues to paste.

Note: the underlying contents of the cell will not actually include the
leading zero, but the leading zero will *display* as specified.
If you want to actually store the leading zero then you'd have to store it
as alpha-numeric text. Numbers don't have leading zeros (except zero
itself).

HTH,
I need to paste numbers to Excel that sometimes begin with 0. How do I do
this without losing the lead 0? I am using Office 2000. You advice is
appreciated.



  #6   Report Post  
Tom
 
Posts: n/a
Default

The custom format idea works for the display, but it does not carry over to
what I need to do with the number. Each of these cells represents part of an
E-mail address and I need all the numbers to make it work. I am using a
formula such as " When I apply the formula I lose the
zero at the front again...any ideas?

"Tom" wrote:

I need to paste numbers to Excel that sometimes begin with 0. How do I do
this without losing the lead 0? I am using Office 2000. You advice is
appreciated.

  #7   Report Post  
George Nicholson
 
Posts: n/a
Default

Each of these cells represents part of an E-mail
address and I need all the numbers to make it work.


Well, in that case you don't need to treat it as a number, just like you
wouldn't treat zip codes, credit card #s or social security number as
numbers (do you doing any addition, subtraction, multiplication with them?)

Try treating your values as text and forcing Excel to see them as text. If
necessary, look at either the Text() worksheet function or, in VBA, the
Format() function.
= Text(2,"0000")
returns the text value of "00002"
Since you need leading zeros stored, avoid use of numeric data types or
formatting cells as numeric (or General for that matter).

HTH,
--
George Nicholson

Remove 'Junk' from return address.


"Tom" wrote in message
...
The custom format idea works for the display, but it does not carry over
to
what I need to do with the number. Each of these cells represents part of
an
E-mail address and I need all the numbers to make it work. I am using a
formula such as " When I apply the formula I lose the
zero at the front again...any ideas?

"Tom" wrote:

I need to paste numbers to Excel that sometimes begin with 0. How do I
do
this without losing the lead 0? I am using Office 2000. You advice is
appreciated.



  #8   Report Post  
Alan Perkins
 
Posts: n/a
Default

Even easier:

Copy all the columns into one column in the way that you have before, and
then use Data | Text to columns option, then in the dialog:
Select either Delimited or Fixed width
Click Next
Check the collumn breaks are where you want them. That's particularly
important if you select the "Fixed Width" option.
Click Next
Select the column that has your number with leading zeroes, and select
"Text" under Column data format (at the top right of the dialog page in the
version that i use)

this will work on the entire column of data if you select all the cells..

HTH

Alan P.


"Tom" wrote in message
...
Alan,

The problem is that the data is being copied out of a web page that
includes
multiple columns of data, if I set it to text, it does import the 0s
however,
it puts all three columns of data in the same column. Any ideas on
cleaning
that up?

Tom Schmitt

"Alan Perkins" wrote:

Tom, one way to do it:

Format the target cell(s) as Text. Then select Edit | Paste Special |
Text
from the Excel menu.

HTH

Alan P.

"Tom" wrote in message
...
I need to paste numbers to Excel that sometimes begin with 0. How do I
do
this without losing the lead 0? I am using Office 2000. You advice is
appreciated.






  #9   Report Post  
Tom
 
Posts: n/a
Default

Thank you, problem solved...

"Tom" wrote:

I need to paste numbers to Excel that sometimes begin with 0. How do I do
this without losing the lead 0? I am using Office 2000. You advice is
appreciated.

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
Pasting HTML table with feet/inches column, excel changes it to da Bothell John Excel Discussion (Misc queries) 0 September 6th 05 06:40 AM
How do I auto number cells in an Excel template? Natalie Excel Discussion (Misc queries) 3 March 30th 05 03:42 AM
Number of dropdown fields in Excel is limited. I need more. How? UweVahrson Excel Discussion (Misc queries) 7 March 28th 05 05:10 PM
lose formatting (border) in excel cell after pasting from word Reverse_Solidus Excel Discussion (Misc queries) 2 March 16th 05 10:01 PM
Difference in number of Excel NewsGroups Hari Prasadh Excel Discussion (Misc queries) 1 January 25th 05 11:32 AM


All times are GMT +1. The time now is 04:38 PM.

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"