+ Reply to Thread
Results 1 to 2 of 2

I need an excel script that will check each cell content and copy stuff

  1. #1
    Registered User
    Join Date
    10-10-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    1

    Lightbulb I need an excel script that will check each cell content and copy stuff

    I need a script to check the number if A? cell in Example1.xlsx matches A? cell in column A in Example2.xlsx, then copy corresponding C cell data in Example1.xls to C cell corresponding row cell in Example2.xlsx

    Example Files
    Example1.xlsx
    Example 2.xlsx

    what finished product would look like if script worked
    Example 3.xlsx
    Last edited by caballar; 10-10-2013 at 11:36 PM.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: I need an excel script that will check each cell content and copy stuff

    You don't need a macro for simple matches like this.

    1) Open both files.

    2) In Example2 cell C2 put this MATCH formula:

    INDEX([Example1.xlsx]Sheet1!$B:$B, MATCH($A2, [Example1.xlsx]Sheet1!$A:$A, 0))

    3) Copy C2 down that column.

    An alternate version of that formula, in case one of the numbers does not match, would be:

    =IFERROR(INDEX([Example1.xlsx]Sheet1!$B:$B, MATCH($A2, [Example1.xlsx]Sheet1!$A:$A, 0)), "")
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

+ 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. check each cell for certain condition, copy the content in a new worksheet
    By cyin in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-21-2012, 09:49 PM
  2. Excel script/formula to copy cell if above cell is null?
    By tdav20 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-15-2012, 06:32 AM
  3. Replies: 1
    Last Post: 04-07-2010, 02:28 PM
  4. Script to Recurse Directory, Open XL files, Copy Stuff etc....
    By xlguy in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-23-2010, 01:59 PM
  5. How to get button to check cell content
    By FoxIII in forum Excel General
    Replies: 1
    Last Post: 02-17-2009, 08:25 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