Consulting

Results 1 to 3 of 3

Thread: Need help modifying VBA code to suit requirements - Listing Uniques based on criteria

  1. #1

    Need help modifying VBA code to suit requirements - Listing Uniques based on criteria

    Hi,
    I've managed to find a pretty good piece of code that takes a list of multiple values (some the same) and creates a unique list from it.

    This is good, and it perfectly suits my requirements on one of my sheets, however, I need to change it slightly to suit my requirements in a different workbook.

    At the moment it just takes one list, filters out the unique and sorts it out into alphanumerical order.
    But with my 2nd workbook, I need it to do the same, but this time... only list the unique depending on the value in another column.

    I've provided an example workbook with some data which hopefully will be easy to understand.

    I've tried a couple of things such as adding rng.offset(0,1) but I'm getting "type mismatch" errors... and I think the reason is because I'm not listing the offset column in an array? I'm not sure though.

    Thanks
    Attached Files Attached Files

  2. #2
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
        For Each Value In rng
            If Len(Value) > 0 And Value.Offset(, 1) <> "" Then ucoll.Add Value, CStr(Value)
        Next Value
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  3. #3
    ahhhhh, I was so close. I was sure it was going to be something simple like that.

    Thanks mdmackillop!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •