+ Reply to Thread
Results 1 to 3 of 3

Keeping Leading Zeroes

  1. #1
    Registered User
    Join Date
    03-29-2007
    Posts
    14

    Keeping Leading Zeroes

    Usual apologies if this is dumb q, I am not a power user, Excel is simply a means to an end for me!

    OK.... Column A contains product codes. These are of the format: 123/1234, i.e. 3 digits, a slash, 4 digits

    In order to get records into my database, I need to remove the slash, so there are just 7 digits (the match field is structured this way in the database). Unfortunately, some product codes have leading zeros, e.g. 058/1234. Even if I format the cells as 'text', removing the slash changes the cell content to '581234'. How can I make it still say '0581234'?

    I just noticed that if I delete an individual slash manually, the zeroes are retained. How can I make it behave like this for a whole column at a time?

    Thanks!
    Last edited by EmmaG1959; 04-09-2008 at 04:48 AM.

  2. #2
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,446
    Hi,

    If you use this formula in column B after formatting it to text...

    =LEFT(A1,3)&RIGHT(A1,4)

    Your leading zeros should remain!
    Rule 1: Never merge cells
    Rule 2: See rule 1

    "Tomorrow I'm going to be famous. All I need is a tennis racket and a hat".

  3. #3
    Registered User
    Join Date
    03-29-2007
    Posts
    14
    That works, thanks... But trouble is this is a file supplied by our customer. I am trying to automate importing it into a database. At present I have to do this myself - I am happy manipulating the data and doing quite a few intermediate steps. But the database users need to be able to do it virtually 'at the push of a button'.

    Inserting a column would change the structure. I suppose they could paste those values back into column A and delete column B, but I was trying to keep it really simple for the users.

    If the end users were on Macs, I guess I could Applescript the whole process (though it sounds scary!), but unfortunately that's not a solution.

    Is it really not possible to just tell a Microsoft product 'I want these zeroes, stop trying to be clever for once!'

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1