+ Reply to Thread
Results 1 to 2 of 2

Comparing and Pasting

  1. #1
    Registered User
    Join Date
    10-30-2009
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003
    Posts
    1

    Comparing and Pasting

    Hello,

    I have 4 columns.

    Col1---|---Col2---|---Col3--|---Col4----|
    ----------|------------|------------|-------------|
    A............SSHH.......B...................
    B............XXYY........C...................

    Now the macro should compare Col1 and Col3. If any value is found in Col3, den paste the text present at Col2 in Col4.

    For e.g. The macro compares Col1 and Col3. It finds B in Col3 and simultaneously it should paste the value XXYY in Col4 (i.e. beside B). It should look like shown below after macro runs.

    Col1---|---Col2---|---Col3--|---Col4----|
    ----------|------------|------------|-------------|
    A...........SSHH........B........XXYY....
    B...........XXYY.........C...................


    Can this be done using normal functions in Excel, or do i need to write a mcaro. If a macro is required, then can anyone provide a macro for this requirement.
    Last edited by himanshu_s123; 10-30-2009 at 04:04 AM.

  2. #2
    Forum Contributor
    Join Date
    04-11-2005
    Location
    London
    Posts
    259

    Re: Comparing and Pasting

    Try
    =IF(ISNA(INDEX($B$1:$B$13,MATCH($C1,$A$1:$A$13,0))),"",INDEX($B$1:$B$13,MATCH($C1,$A$1:$A$13,0)))
    in cell D1.

    This will only work if the values in column A are unique.
    Martin Short

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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