+ Reply to Thread
Results 1 to 6 of 6

Single Criteria Multiple Matches

  1. #1
    Registered User
    Join Date
    09-27-2009
    Location
    texas
    MS-Off Ver
    mac 2004
    Posts
    6

    Single Criteria Multiple Matches

    Hi. I am very new to VBA and need help with a macro. I am comparing Sheet1 Column A in two different workbooks. WB1 has the same order numbers as Column A in WB2 but WB2 could have the order number listed multiple times but not always. I need the macro to return the data in 2 columns, H & B of WB2 to Column B & K, respectively, of WB1 for each instance of the order number. This is why a simple vlookup will not work. So a new row needs to be inserted below the order number in WB1 if there is more than one instance of it in WB2. Basically the below steps.

    1. Match order #'s in ColA WB1 to ColA WB2.
    2. Paste data from WB2 Cols H&B to Cols B&K in original row of WB1.
    3. Then insert new row directly beneath order # in WB1 for each duplicate order number and paste order # in ColA and data from Cols H&B to Cols B&K.

    Does this make any sense?
    Can anyone help?

    I have include sample copies of the workbooks.

    Thank you.
    Attached Files Attached Files
    Last edited by mtntxn; 01-08-2011 at 01:56 AM.

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,169

    Re: Single Criteria Multiple Matches

    Hi mtntxn,

    If you really are using a Mac 2008 version of Microsoft Excel, I'm not sure they support VBA macros. I believe the newest Mac 2011 version of Excel does support them.

    If your profile is incorrect and you are using a PC then please correct it and let us know.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Registered User
    Join Date
    09-27-2009
    Location
    texas
    MS-Off Ver
    mac 2004
    Posts
    6

    Re: Single Criteria Multiple Matches

    My apologies. I am using Mac 2004.
    Last edited by mtntxn; 01-08-2011 at 02:01 AM.

  4. #4
    Registered User
    Join Date
    09-27-2009
    Location
    texas
    MS-Off Ver
    mac 2004
    Posts
    6

    Re: Single Criteria Multiple Matches

    Quote Originally Posted by MarvinP View Post
    Hi mtntxn,

    If you really are using a Mac 2008 version of Microsoft Excel, I'm not sure they support VBA macros. I believe the newest Mac 2011 version of Excel does support them.

    If your profile is incorrect and you are using a PC then please correct it and let us know.
    I updated my profilr and am using mac 2004. Can you offer any assistance with the macro I am looking for?

  5. #5
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,169

    Re: Single Criteria Multiple Matches

    I believe Apple uses Scripts instead of VBA. I'm clueless on the Apple Script topic.
    Here is a link http://support.microsoft.com/kb/113891 but I'm not the guy to help on a Mac question.

  6. #6
    Registered User
    Join Date
    09-27-2009
    Location
    texas
    MS-Off Ver
    mac 2004
    Posts
    6

    Re: Single Criteria Multiple Matches

    Yes, but I am not looking for an Applescript. I want to use an excel macro for this fix. As I work in several versions of excel Applescripts will not work..

+ 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