Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Sweetetc
 
Posts: n/a
Default How can I prefill a text field with leading 0s?

I have a list on Text data
ie 1, 14, 203, etc
I want them all to be 6 charcters long.
ie 000001, 000014, 000203, etc.
I can concatenate but the I would manually need to remove extra 0's Any
suggestions

--
Thanks
ETC
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bob Phillips
 
Posts: n/a
Default How can I prefill a text field with leading 0s?

Set the format to 000000 (FormatCellsCustom)

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Sweetetc" wrote in message
...
I have a list on Text data
ie 1, 14, 203, etc
I want them all to be 6 charcters long.
ie 000001, 000014, 000203, etc.
I can concatenate but the I would manually need to remove extra 0's Any
suggestions

--
Thanks
ETC



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Duke Carey
 
Posts: n/a
Default How can I prefill a text field with leading 0s?

If it is for display purposes, you can format (numbers, not text) using a
custom format of "000000"

If you need the values to 6 characters you can use for numeric values:
=text(number, "000000")

For text values:
=rept("0",6-len(text value))&text value


"Sweetetc" wrote:

I have a list on Text data
ie 1, 14, 203, etc
I want them all to be 6 charcters long.
ie 000001, 000014, 000203, etc.
I can concatenate but the I would manually need to remove extra 0's Any
suggestions

--
Thanks
ETC

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Gary''s Student
 
Posts: n/a
Default How can I prefill a text field with leading 0s?

Format Cells... Number Custom and enter 000000
--
Gary's Student


"Sweetetc" wrote:

I have a list on Text data
ie 1, 14, 203, etc
I want them all to be 6 charcters long.
ie 000001, 000014, 000203, etc.
I can concatenate but the I would manually need to remove extra 0's Any
suggestions

--
Thanks
ETC

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Sweetetc
 
Posts: n/a
Default How can I prefill a text field with leading 0s?

Duke

Thanks the TXT seemed to do the trick. I could not get the REPT to work
correctly
--
Thanks
ETC


"Duke Carey" wrote:

If it is for display purposes, you can format (numbers, not text) using a
custom format of "000000"

If you need the values to 6 characters you can use for numeric values:
=text(number, "000000")

For text values:
=rept("0",6-len(text value))&text value


"Sweetetc" wrote:

I have a list on Text data
ie 1, 14, 203, etc
I want them all to be 6 charcters long.
ie 000001, 000014, 000203, etc.
I can concatenate but the I would manually need to remove extra 0's Any
suggestions

--
Thanks
ETC

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
Stop excel from dropping the 0 in the beginning of a number? Rosewood Setting up and Configuration of Excel 12 April 4th 23 02:12 PM
Changing a text field to a date field juliet New Users to Excel 4 February 21st 06 09:52 PM
Some lines of text in Excel field do not wrap text. Please help. Michele Excel Discussion (Misc queries) 0 January 5th 06 07:27 PM
zero supress leading zeros when chg format from text to number HeatherO Excel Worksheet Functions 4 February 27th 05 11:11 PM
Sort or Filter option? Mcobra41 Excel Worksheet Functions 3 February 23rd 05 07:22 PM


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

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

About Us

"It's about Microsoft Excel"