+ Reply to Thread
Results 1 to 6 of 6

Auto number code

  1. #1
    Registered User
    Join Date
    03-08-2007
    Posts
    23

    Auto number code

    I Found This code To Make Auto Numbring but I don't know how can I change the code to change the Starting Cell & How can I choose the column & row In this code ?

    Please Login or Register  to view this content.
    Attached Files Attached Files

  2. #2
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229
    The outer parts of the code say that whenever the value of a cell is changed, if the changed cell is in column 2 ("B"), then run the inner code, otherwise do nothing.
    Please Login or Register  to view this content.
    The inner part of the code says that if the cell in column A next to the changed cell is now blank, put a formula in that cell of column A. If the neighboring cell is not now blank, then empty that cell.
    Please Login or Register  to view this content.
    The formula says "If the cell in column B is not empty then display [the number of entries in column B above this row] minus one, otherwise display nothing."

    To change things, the line would be changed to match the column you are interested in.
    Please Login or Register  to view this content.
    The "2" in the line below can be changed to change which row displays 0, which is currently row 2. (Changes the "minus one" to "minus something else".)
    Please Login or Register  to view this content.
    I hope this helps.
    Last edited by mikerickson; 10-07-2007 at 09:45 PM.

  3. #3
    Registered User
    Join Date
    03-08-2007
    Posts
    23
    Big Thank's for you My dear

    But I still don't know what i Have To change to choose the starting cell ?

    I knew Now what I should change to change the column

    but how can i choose the starting cell ??

    for example lets make the auto numbering In coulumn " c " But Start Numbring If I write In " c 10 " and Below

    Thanks again

  4. #4
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229
    This 2 is what you need to change. If you set it to 9, a 0 will be put in C9 a 1 in C10, etc.
    "=IF(COUNTA(RC[1]:RC[1])=1,COUNTA(R2C[1]:RC[1]),"""")"

    The routine that you found and posted is not very generic and is difficult to change. A detailed explaination of what you want might result in a routine tailored to your specific needs.

  5. #5
    Registered User
    Join Date
    03-08-2007
    Posts
    23
    i still have problem

    please see the attachment .. i change the starting cell , but now tray to write above B5 and see
    Attached Files Attached Files

  6. #6
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229
    I wrote a different routine. The starting cell is easier to modify. There are two versions.
    The current version puts a number in the cell rather than a formula. This will improve the speed of your spreadsheet, but will not react to inserting or deleting rows.
    The line that is currently commented out, puts a formula in the cell, which will react to inserting or deleting rows, but slows the spreadsheet a bit.
    Please Login or Register  to view this content.

+ 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