Closed Thread
Results 1 to 8 of 8

Excel 2007 : VBA Help Needed to Create a Macro to create a Unique Number...

Hybrid View

  1. #1
    Valued Forum Contributor tlafferty's Avatar
    Join Date
    04-08-2011
    Location
    United States, Tacoma, WA
    MS-Off Ver
    Excel 2010, Excel 2013 Customer Preview
    Posts
    1,112

    Re: VBA Help Needed to Create a Macro to create a Unique Number...

    The code in the attached workbook will generate a new ID number based on the greatest value it finds in the D column. If you are inserting a single ID number, position your cursor in the blank cell where you want to place the ID number, and run the macro NewID. If you want to generate more than one, select the cells in which you want to place the ID. CAUTION! This will place an incremented number in EVERY cell you select, so only select cells in the D column. As for your sorting issue, I still need more information. What column are you sorting by, and what other levels of sort are you applying?
    Attached Files Attached Files
    If your question has been satisfactorily addressed, please consider marking it solved. Click the Thread Tools dropdown and select Mark thread as solved.
    Also, you might want to add to the user's reputation by clicking the star icon in the lower left corner of the post with the answer- it's why we do what we do...

    Thomas Lafferty
    Analyst/Programmer

  2. #2
    Registered User
    Join Date
    10-25-2011
    Location
    Des Moines, Iowa
    MS-Off Ver
    Excel 2007
    Posts
    18

    Smile Re: VBA Help Needed to Create a Macro to create a Unique Number...

    tlafferty.... Thank you for your kind assistance with this question. Let me clarify a little bit. The code would need to recognize the last row with data in it and start from cell D2. The sorting is done by filters in the header row. Please see attached workbook for reference.

    Thanks again for all of your help with this. It is greatly appreciated.
    Attached Files Attached Files

Closed 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