Results 1 to 5 of 5

VBA Unique values from 2 columns based on condition

Threaded View

  1. #1
    Registered User
    Join Date
    03-01-2020
    Location
    Paris
    MS-Off Ver
    Office 2016
    Posts
    28

    VBA Unique values from 2 columns based on condition

    Hello All,

    I have 2 columns - A and B and I want to extract unique values from column A and B . When Column B is not null then it should be considered otherwise column A.

    Below is the code I use to copy from 1 column,

    Data.Range("F2:F" & lastrow).SpecialCells(xlCellTypeVisible).Copy
    Anchor.Cells(10, 1).PasteSpecial
    Anchor.Columns(1).RemoveDuplicates Columns:=Array(1)

    how do I modify this to my requirement. Please provide your suggestions. Have attached an excel as an example.

    Thanks

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Generate unique list of values based on condition in another table column with VBA
    By dabasir in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-16-2019, 09:12 PM
  2. count unique values based on 1 condition
    By penfolda in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-05-2014, 10:28 PM
  3. Required Unique values based on if condition (array)
    By Punnam in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 09-30-2014, 01:09 AM
  4. Counting unique values based on condition in a different column
    By rafuk73 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-21-2014, 02:59 PM
  5. [SOLVED] counting unique values based on a condition with autofiltering
    By sammybr in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 03-20-2014, 06:27 PM
  6. Count unique values based on condition
    By pradeev in forum Excel General
    Replies: 4
    Last Post: 06-12-2012, 10:43 AM
  7. Replies: 2
    Last Post: 01-17-2012, 07:48 AM

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