+ Reply to Thread
Results 1 to 3 of 3

VBA for Unique Pick Numbers for unique Order Numbers

  1. #1
    Registered User
    Join Date
    05-24-2017
    Location
    Long Island, NY
    MS-Off Ver
    2010
    Posts
    8

    Question VBA for Unique Pick Numbers for unique Order Numbers

    I am trying to write VBA code for a macro that will assign a unique pick number for each unique order number. Matching order numbers will get matching pick numbers. In other words, orders: A, A, A, B, & B will be assigned pick numbers 1,1,1,2,& 2. How do I go about doing so? I did write basic pseudo code but I am unsure its accuracy to what I want to accomplish:

    For each ROW:
    if PO in ROW-1 == PO in ROW-1 then:
    PN=PN
    ELSE:
    PN=PN+1
    NEXT ROW

    For visual example, I provided a link to a screenshot taken from EXCEL 2010.

    SCREENSHOT
    Last edited by gshowman1; 05-25-2017 at 11:56 AM.

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: VBA for Unique Pick Numbers for unique Order Numbers

    Hi you don't need a macro.

    Just put 9000 in A1 and in A2 copied down

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    05-24-2017
    Location
    Long Island, NY
    MS-Off Ver
    2010
    Posts
    8

    Re: VBA for Unique Pick Numbers for unique Order Numbers

    Wow thank you Richard! I over thought this when there was a simple solution.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 8
    Last Post: 05-26-2016, 06:00 PM
  2. [SOLVED] Extracting Unique numbers from a cell in numberic order
    By skyping in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-17-2014, 12:37 PM
  3. [SOLVED] search for all unique numbers down a column and print a list of those numbers in another
    By JJGF in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-05-2014, 11:08 PM
  4. Replies: 1
    Last Post: 10-16-2013, 02:46 PM
  5. Replies: 5
    Last Post: 07-22-2013, 05:56 PM
  6. [SOLVED] create list of unique staff numbers with unique work codes
    By shaz0503 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-01-2013, 08:57 PM
  7. [SOLVED] Macro to pick random unique numbers from lsit
    By dinesh_ltjd in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-16-2012, 02:11 PM

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