+ Reply to Thread
Results 1 to 4 of 4

Macro for copying data from one column in sheet 2 based on two criterias in sheet 1

  1. #1
    Registered User
    Join Date
    07-13-2012
    Location
    Norway
    MS-Off Ver
    Excel 2003
    Posts
    4

    Macro for copying data from one column in sheet 2 based on two criterias in sheet 1

    Hi.

    I've been struggeling for quite som time on how to perform this task with the help of macros.
    I have a workbook with basicly two sheets.
    Sheet1 is the main sheet, but I'm missing som data in the column "IB". This data is in another sheet. I would like to create a macro that checks the cokumns company and accountnumber i sheet1 against the same information in sheet2, if correct then copy the corresponding IB cell and paste into sheet1.

    I hope someone can help me with this?

    Best regards!
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,651

    Re: Macro for copying data from one column in sheet 2 based on two criterias in sheet 1

    You could do this with a formula.

    Put this in D2 on Mainsheet and copy down column D

    =INDEX(Sheet2!$C$1:$C$28,MATCH(1,(A2=Sheet2!$A$1:$A$28)*(C2=Sheet2!$B$1:$B$28),0))

    This is an array formula. Confirm the formula with Ctrl+Shift+Enter

  3. #3
    Registered User
    Join Date
    07-13-2012
    Location
    Norway
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Macro for copying data from one column in sheet 2 based on two criterias in sheet 1

    Hey, that worked out brilliantly! Thank you so much for your help
    Have a nice day!

    Best regards

  4. #4
    Valued Forum Contributor Naveed Raza's Avatar
    Join Date
    11-04-2012
    Location
    India, Hyderabad
    MS-Off Ver
    Excel, Access 2007/2010
    Posts
    1,338

    Re: Macro for copying data from one column in sheet 2 based on two criterias in sheet 1

    Hi,

    Please have a review of this attached file and let me know is it meet ur requirement or not.

    that Array formula make whole active workbook performance very very slow.

    I hv updated the formula.
    =IFERROR(VLOOKUP(CONCATENATE($A2&" > "&$C2),Sheet2!$A:$D,4,0),"")

    Thanks- Naveed
    Attached Files Attached Files

+ 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