Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 14
Default Reformatting a column

In Excel I have a column that contains a number of values, for example:
5231
306
345
70

I want to remformat the column as follows:
00000523100
00000030600
00000034500
00000007000

(add two zeros to end and pad the front with enough zeros so the column
contains 11 characters total)

Anyone know of a macro or formatting technique to do so easily? Thanks.

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,203
Default Reformatting a column

Assuming they start at A1, in B1 use:
=A1 * 100
that will add your trailing 2 zeros.
Then use Format Cells and Custom and just type in 11 zeros as the format:
00000000000
and they will show up as desired, and still be numbers!
you could then Copy and Paste Special with Values selected to get rid of the
formula and make them values. The key to keeping the leading zeros is always
going to be the Format applied to the cells they are in.

"Janna" wrote:

In Excel I have a column that contains a number of values, for example:
5231
306
345
70

I want to remformat the column as follows:
00000523100
00000030600
00000034500
00000007000

(add two zeros to end and pad the front with enough zeros so the column
contains 11 characters total)

Anyone know of a macro or formatting technique to do so easily? Thanks.

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 341
Default Reformatting a column

Or, if you really want them to have 11 digits and not be numbers any more
(maybe they are product codes or something), how about this.

Col A Col B
5231 =REPT("0",9-LEN(A2))&A2&"00"
306 =REPT("0",9-LEN(A3))&A3&"00"
345 etc
70 etc

Then you could copy Column B and do EditPaste SpecialValues to fix those
values in the cells.
--
Allllen


"Janna" wrote:

In Excel I have a column that contains a number of values, for example:
5231
306
345
70

I want to remformat the column as follows:
00000523100
00000030600
00000034500
00000007000

(add two zeros to end and pad the front with enough zeros so the column
contains 11 characters total)

Anyone know of a macro or formatting technique to do so easily? Thanks.

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,886
Default Reformatting a column

Hi Janna

Assuming data in column A
Format Column B, FormatCellsNumberCustom 00000000000 (11 zeros)
In B1
=A1*100
Copy down as far as required.
Copy the whole of column B, Paste SpecialValues to fix the data
Delete column A if required.

--
Regards

Roger Govier


"Janna" wrote in message
...
In Excel I have a column that contains a number of values, for
example:
5231
306
345
70

I want to remformat the column as follows:
00000523100
00000030600
00000034500
00000007000

(add two zeros to end and pad the front with enough zeros so the
column
contains 11 characters total)

Anyone know of a macro or formatting technique to do so easily?
Thanks.



  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 14
Default Reformatting a column

Thanks guys..That works for me!

"Janna" wrote:

In Excel I have a column that contains a number of values, for example:
5231
306
345
70

I want to remformat the column as follows:
00000523100
00000030600
00000034500
00000007000

(add two zeros to end and pad the front with enough zeros so the column
contains 11 characters total)

Anyone know of a macro or formatting technique to do so easily? Thanks.

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
Stock data manipulation [email protected] Excel Worksheet Functions 1 June 12th 06 11:06 PM
Column picked randomly with probability relative to number of entr Neil Goldwasser Excel Worksheet Functions 4 May 30th 06 08:55 AM
Return SEARCHED Column Number of Numeric Label and Value Sam via OfficeKB.com Excel Worksheet Functions 23 January 30th 06 06:16 PM
creating a bar graph Johnfli Excel Discussion (Misc queries) 0 October 26th 05 08:16 PM
Return Count for LAST NonBlank Cell in each Row Sam via OfficeKB.com Excel Worksheet Functions 12 April 17th 05 10:36 PM


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