+ Reply to Thread
Results 1 to 5 of 5

Search column in one spreadsheet to output info into another column in another spreadsheet

  1. #1
    Registered User
    Join Date
    07-17-2013
    Location
    Norfolk, Virginia
    MS-Off Ver
    Excel 2010
    Posts
    10

    Search column in one spreadsheet to output info into another column in another spreadsheet

    I have two excel sheets (in two separate files). I need to write a macros that will look at column Q on sheet "InspectionPlanByContract" and observe if the each cell is filled or not (cell either has "No Insp Req" or is empty). Each of these cells is connected to a corresponding Item No.
    If cell is filled with "No Insp Req," then column AI in Sheet1 (of the second excel file) needs to be filled with "NAR." Right now, I have a function to do this:
    =IF(ISNUMBER(SEARCH("No Insp Req",'[Copy of InspectionPlanByContract_Excel_041813A2.xlsx]InspectionPlanByContract_Excel'!$Q$1:$Q$4421)),"NAR","")

    The problem is, some of the cells in column AI (on Sheet1 of the second excel file) are filled, some are not. If the cells (in column AI) are filled, I need that infomation to remain; if the cell is empty, I need the cell to be updated (either filled with NAR, based on the information above or left empty).
    All of the information in the spreadsheets corresponds to specific item numbers and other info. I need this info. to stay intact.
    Last edited by mary.gallagher; 07-24-2013 at 02:44 PM.

  2. #2
    Registered User
    Join Date
    07-21-2013
    Location
    Bournemouth
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Search column in one spreadsheet to output info into another column in another spreads

    Hi Mary,

    Here is a Loop that should do the job, you will need to change the names of the workbooks in the code.

    Please Login or Register  to view this content.
    Hope that helps,

    Matt

  3. #3
    Registered User
    Join Date
    07-17-2013
    Location
    Norfolk, Virginia
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Search column in one spreadsheet to output info into another column in another spreads

    Matt,
    Thank you so much! Unfortunately, when I use this code, I get the error message of: Run-time error '9': Subscript out of range

    I have never worked with Excel macros before so I am probably doing something wrong. I tried putting this code in each of the files, because I thought maybe it was in the wrong place?
    I went to the "Developer' tab and under 'Controls' I clicked 'View Code.' I then copied and pasted the code (and changed the names of my workbooks). But when I hit 'Run' (the green arrow button), I get the error message. Any suggestions?

    I would appreciate any info. you can provide! Thank you again!

    Mary

  4. #4
    Registered User
    Join Date
    07-21-2013
    Location
    Bournemouth
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Search column in one spreadsheet to output info into another column in another spreads

    Hi

    Could you check these things for me.

    1. You have the right file extension the files could be ".xlsm" or ".xlsx" just change the "m" or "x" in the code to fit the file type.
    2. That both workbooks are currently open.
    3. Check the sheet names in the code are correct, in your post you said they were "InspectionPlanByContract" and "Sheet1" if these are wrong just correct them

    ... Actually looking back at your equation in the post I think the issue is the sheet is called "InspectionPlanByContract_Excel" not "InspectionPlanByContract" just change that and you should be fine.

    as for the code you can paste it in a module in either workbook and it should run fine.

    Cheers,

    Matt

  5. #5
    Registered User
    Join Date
    07-17-2013
    Location
    Norfolk, Virginia
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Search column in one spreadsheet to output info into another column in another spreads

    It works! Thank you both so much for your help!

+ 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. [SOLVED] Convert 2-Column Spreadsheet to Multi-Columns based on 1 Column
    By jdegeorge in forum Excel General
    Replies: 15
    Last Post: 09-12-2012, 05:45 PM
  2. search for value in a row, copy column to another spreadsheet
    By menos in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-11-2011, 10:43 AM
  3. Autopopulate a spreadsheet based on specific info from another spreadsheet
    By Boitumelo in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-07-2011, 05:48 AM
  4. Replies: 3
    Last Post: 04-05-2011, 04:56 AM
  5. [SOLVED] linking a column in one spreadsheet to another spreadsheet
    By N Richard in forum Excel General
    Replies: 1
    Last Post: 01-20-2006, 10:10 PM

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