#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 13
Default Leading Zeros

I have a list of 1300 UPC's that I need to bring into Excel. The original
list is in SQL. I know the tricks of formatting a cell as TEXT or Custom to
the # of characters in your data, but if/when I do that, and I go to SQL and
copy the data, then go to Excel and paste it in, the formatting does not
stay.

The UPC's are not uniform, in that each one contains 1 leading zero. Some
may have 2, 3, 4, etc leading zeros. But each is 13 characters long.

Any suggestions as to how to get Excel (I am running 2007) to keep these
zeros?

Seems like people have complained about this forever and Microsoft has never
fixed it.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 846
Default Leading Zeros

format - numbers - custom - 0000000000000 (13 zeros)

HTH

"JSpence2003" wrote:

I have a list of 1300 UPC's that I need to bring into Excel. The original
list is in SQL. I know the tricks of formatting a cell as TEXT or Custom to
the # of characters in your data, but if/when I do that, and I go to SQL and
copy the data, then go to Excel and paste it in, the formatting does not
stay.

The UPC's are not uniform, in that each one contains 1 leading zero. Some
may have 2, 3, 4, etc leading zeros. But each is 13 characters long.

Any suggestions as to how to get Excel (I am running 2007) to keep these
zeros?

Seems like people have complained about this forever and Microsoft has never
fixed it.

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 281
Default Leading Zeros

Hi,

As my underestanding you input some data from SQL to Excel and because of
the data was numbers you lost the Zeros in the left of your data so if i am
right then you can use a helper column and enter the formula below in it
assumed your data is in column A enter this formula in B1

=REPT("0",13-LEN(A1))&A1

and then copy drag down to where ever you need after that you can select all
data in column B and copypaste especialvalue in column A

Thanks,
--
Farhad Hodjat


"JSpence2003" wrote:

I have a list of 1300 UPC's that I need to bring into Excel. The original
list is in SQL. I know the tricks of formatting a cell as TEXT or Custom to
the # of characters in your data, but if/when I do that, and I go to SQL and
copy the data, then go to Excel and paste it in, the formatting does not
stay.

The UPC's are not uniform, in that each one contains 1 leading zero. Some
may have 2, 3, 4, etc leading zeros. But each is 13 characters long.

Any suggestions as to how to get Excel (I am running 2007) to keep these
zeros?

Seems like people have complained about this forever and Microsoft has never
fixed it.

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
Leading Zeros Ben Watts Excel Worksheet Functions 8 September 26th 07 05:44 PM
Leading zeros mary Excel Discussion (Misc queries) 1 January 18th 06 01:56 PM
leading zeros P. Zicari Excel Discussion (Misc queries) 3 November 18th 05 04:31 PM
Leading zeros Paul Excel Discussion (Misc queries) 4 June 12th 05 04:04 AM
save text field w/ leading zeros in .csv format & not lose zeros? Ques Excel Discussion (Misc queries) 1 May 4th 05 06:21 PM


All times are GMT +1. The time now is 01:21 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"