+ Reply to Thread
Results 1 to 2 of 2

Compare different cell data in different sheets in VBA

  1. #1
    Registered User
    Join Date
    03-04-2014
    Location
    manila, philippines
    MS-Off Ver
    Excel 2010
    Posts
    22

    Compare different cell data in different sheets in VBA

    Hi Can I ask for a sample macro code to compare 2 different columns from 2 different sheets. At the end there' my code

    Here's the columnA in sheet1

    ColumnA ColumnB
    red
    orange
    blue
    green

    Here's the column A in sheet2

    ColumnA
    ABC:green
    ABC:pink
    ABC:violet
    ABC:blue
    ABC:orange
    ABC:black

    Here's what I need to make as an output in sheet1

    ColumnA ColumnB
    red
    orange ABC:orange
    blue ABC:blue
    green ABC:green


    Then all cells in column A sheet1 without match such as red in the picture above should be cut and copied in column C in sheet1 like the below

    ColumnA ColumnB ColumnC
    orange ABC:orange red
    blue ABC:blue
    green ABC:green

    lastly all cells in column A sheet 2 that has no match should be cut as well and pasted in column D in sheet 1 such as ABC:PINK, ABC:VIOLET and ABC:BLACK as shown below

    ColumnA ColumnB ColumnC ColumnD
    orange ABC:orange red ABC:pink
    blue ABC:blue ABC:violet
    green ABC:green ABC:black

    Thanks for the help in advance.
    Now here's my code (this is as far as I can go ince i'm still a newbie consider the knowledge i have with regards to VAB coding

    Please Login or Register  to view this content.
    Attached Images Attached Images

  2. #2
    Valued Forum Contributor
    Join Date
    08-22-2011
    Location
    Auckland
    MS-Off Ver
    Excel 2019
    Posts
    716

    Re: Compare different cell data in different sheets in VBA

    If you attach a sample workbook instead of a picture you will get more interest

+ 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. compare data on 2 sheets
    By srive99 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-17-2013, 05:48 PM
  2. Replies: 3
    Last Post: 03-30-2012, 07:21 AM
  3. Compare 2 columns in 2 sheets then enter data from a 3rd cell? Help!
    By julietayl in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-28-2012, 09:18 AM
  4. How to compare data in two sheets?
    By Novice09 in forum Excel General
    Replies: 0
    Last Post: 02-18-2011, 05:01 AM
  5. Compare 3 Sheets of Data
    By dagindi in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-26-2010, 01:26 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