+ Reply to Thread
Results 1 to 6 of 6

How do I generate a sequential serial number every time I tab to a new line?

  1. #1
    Registered User
    Join Date
    04-27-2009
    Location
    Stockholm, Sweden
    MS-Off Ver
    Excel 2007
    Posts
    5

    How do I generate a sequential serial number every time I tab to a new line?

    I am trying to create a chart which would auto serial number every time I start a new line.

    Example,


    000-001
    000-002
    000-003
    etc etc.

    I only want the serial number to appear when a new line is started, not before.


    I tried a VBA code, which worked for a while but for some reason it has stopped.

    Please Login or Register  to view this content.

    I could really use some help!

    I am using excel 2007 at work. I know that Access would probably be better but unfortunately I am using a work computer and the have Excel.
    Last edited by royUK; 04-27-2009 at 07:24 AM.

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: How do I generate a sequential serial number every time I tab to a new line?

    depends but with
    000-000 in a1
    in a2
    =IF(ISBLANK(B2),"",IF(RIGHT(A1,3)="999",TEXT(LEFT(A1,3)+1,"000")&"-000",LEFT(A1,4)&TEXT(RIGHT(A1,3)+1,"000")))
    dragged down
    will auto number as soon as something is entered in b2
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: How do I generate a sequential serial number every time I tab to a new line?

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here

    I have added them for you this time

    This code might be what you want

    Please Login or Register  to view this content.
    Copy the code
    Select the worksheet in which you want the code to run
    Right click on the sheet tab and choose View Code, to open the Visual Basic Editor.
    Where the cursor is flashing, choose Edit | Paste
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  4. #4
    Registered User
    Join Date
    04-27-2009
    Location
    Stockholm, Sweden
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: How do I generate a sequential serial number every time I tab to a new line?

    Thanks for that, literally just saw that as I logged on again. Sorry. Was in a serious rush!

  5. #5
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: How do I generate a sequential serial number every time I tab to a new line?

    Does the code do what you want?

  6. #6
    Registered User
    Join Date
    04-27-2009
    Location
    Stockholm, Sweden
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: How do I generate a sequential serial number every time I tab to a new line?

    Have tried the code but for some reason not working at all. However, this may be because i am a complete novice.

    What i want is for all the sequential serial numbering to happen in column A as this is the row i have designated for the serial numbers. Row B is something else.

+ 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