LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default Using REPLACE command removes leading zeros

I have struggled with this for a long time and I don't know if it's a bug in
Excel (2003 and 2007) or if it's something I just need to learn how to do
correctly. The problem is I get a list of account #'s similar to the list
below.

022491806-0101-030
033547786-0101-019
014186194-0101-079
010217379-0101-150
028456385-0101-027

I have to remove the hypens in the account numbers. If I manually remove
the hypens by editing each record then everything works fine. If I use the
REPLACE command to replace - with nothing the accounts lose their leading 0.
I've tried setting the column formatting to TEXT or GENERAL before doing the
replace but get the same result.

This doesn't make sense to me. I would have thought if I set the format to
TEXT that it would retain the leading zero.

I now there are many other ways to do this but I really want to understand
if this is by design in Excel and I'm just not using the correct technique or
if this is a bug. If it is by design and someone can explain the design to
me that would be fantastic.

If anyone has any answers for me I'd be very much appreciative.

Guy
 
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 JSpence2003 Excel Discussion (Misc queries) 2 November 14th 07 09:28 PM
Leading Zeros Ben Watts Excel Worksheet Functions 8 September 26th 07 05:44 PM
Replace Function Removes Text Formats In Cell Angst Excel Discussion (Misc queries) 0 March 9th 07 05:28 PM
Leading Zeros [email protected] Excel Discussion (Misc queries) 6 August 3rd 06 06:15 PM
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 09:52 PM.

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"