+ Reply to Thread
Results 1 to 6 of 6

Auto Generate Number for New Task

  1. #1
    Registered User
    Join Date
    04-29-2010
    Location
    New York, US
    MS-Off Ver
    Excel 2007
    Posts
    4

    Auto Generate Number for New Task

    Hi,

    I need a macro that will generate the next sequential number when I enter a new row/task.

    Next sequential number should be 1 number after the total of tasks already in the workbook on different worksheets.

    So doesn't matter which worksheet I put the new row/task, it will generate the next number in Column A on the same worksheet.

    Any help or input is appreciated.

    Thank you

    Brian

  2. #2
    Forum Expert davegugg's Avatar
    Join Date
    12-18-2008
    Location
    WI, US
    MS-Off Ver
    2010
    Posts
    1,884

    Re: Auto Generate Number for New Task

    How do we know what the total of tasks already in the workbook on different worksheets is?
    Do you use an existing macro to enter a new row/task?
    Is your code running too slowly?
    Does your workbook or database have a bunch of duplicate pieces of data?
    Have a look at this article to learn the best ways to set up your projects.
    It will save both time and effort in the long run!


    Dave

  3. #3
    Registered User
    Join Date
    04-29-2010
    Location
    New York, US
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Auto Generate Number for New Task

    Only macro I have put in is to move a task to another sheet once the "status" column is changed to Completed.

    I was thinking that the macro i'm asking about can count how many total tasks there are currently and generate the next number when a new row is entered.
    Or look for the highest number there is and generate the next number automactically when i put in a new row in any sheet.

    Btw, that number is specific to that task. So any number generated will be in Column A of the same worksheet.

  4. #4
    Registered User
    Join Date
    04-29-2010
    Location
    New York, US
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Auto Generate Number for New Task

    sorry, if this is confusing.
    not sure how else i can put it.
    I can attach a sample if it helps.

  5. #5
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Auto Generate Number for New Task

    Here's a non-macro method.

    1) Choose an empty cell and enter a formula that does a 3D lookup across all sheets to find the current highest number...and add 1 to it.

    =MAX(First:Last!$A:$A)+1

    2) Name that cell NextNumber

    3) Create a Data Validation Drop Down list in the column on all sheets where the Task # is being inserted using List: =NextNumber

    Now each time you click on the drop down in any sheet it will display a single number to choose from...the next task number.

    Check out this sample sheet...try using any empty cell in column A on any sheet.
    Attached Files Attached Files
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  6. #6
    Registered User
    Join Date
    04-29-2010
    Location
    New York, US
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Auto Generate Number for New Task

    This could work.

    Thank you very much.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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