+ Reply to Thread
Results 1 to 3 of 3

VBA for Unique Values

Hybrid View

  1. #1
    Registered User
    Join Date
    12-09-2015
    Location
    Pittsburgh
    MS-Off Ver
    2010
    Posts
    2

    VBA for Unique Values

    Hi there,
    I need some help creating (what I think should be) an If statement.

    I have a list of duplicate values, and need to apply a unique number to each occurrence of the duplicate value. I need this to be done automatically and advance by 100 each change in value. See below:

    1/2/2015 - 100
    1/2/2015 - 100
    1/2/2015 - 100
    1/3/2015 - 200
    1/4/2015 - 300
    1/4/2015 - 300

    Thank you for any help!
    Last edited by l.syers; 12-09-2015 at 10:51 AM.

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,755

    Re: VBA for Unique Values

    VBA isn't required for this. In B1, type in 100 as the first value. Then put this formula in B2 and fill down. This assumes that all duplicate values are contiguous, as in your example.

    Formula: copy to clipboard
    =IF(A2=A1,B1,B1+100)
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    12-09-2015
    Location
    Pittsburgh
    MS-Off Ver
    2010
    Posts
    2

    Re: VBA for Unique Values

    Thank you!

+ 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: 2
    Last Post: 08-19-2015, 10:22 AM
  2. [SOLVED] Using INDEX MATCH to return unique values for non-unique search term
    By rico_suave in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 06-03-2015, 01:53 AM
  3. Replies: 1
    Last Post: 01-29-2015, 04:08 PM
  4. [SOLVED] count unique values based on unique values
    By neetu.aggarwal in forum Excel General
    Replies: 13
    Last Post: 10-23-2012, 04:00 AM
  5. [SOLVED] Sum unique values according to criteria (sumif unique values)
    By hmpw in forum Excel General
    Replies: 8
    Last Post: 07-14-2012, 06:21 AM
  6. Replies: 0
    Last Post: 03-08-2012, 12:18 PM
  7. scaling an exisiting macro for unique values of X for Unique values of Y.
    By widodude in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-18-2011, 09:33 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