+ Reply to Thread
Results 1 to 17 of 17

How to search multiple workbooks for a specific value in a specific cell

  1. #1
    Registered User
    Join Date
    07-22-2008
    Location
    ctown
    Posts
    35

    How to search multiple workbooks for a specific value in a specific cell

    I'm trying to search through multiple worksheets (that are closed) to see if a value in cell B12 (of every worksheet) matches a value in a seperate worksheet (which is in a seperate workbook)

  2. #2
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591
    Hi

    1) Where is the file being searched? In the same place as the file that you wish to compare?
    2) Can the closed file be opened for testing?
    3) Is there a fixed number of sheets in the closed file, and do they have a constant name?
    4) What do you want to do with the result of the test?

    I'm sure there are more details required, so how about giving us some more details on exactly what you want to do so we can offer some assistance.


    rylo

  3. #3
    Forum Contributor
    Join Date
    02-27-2008
    Posts
    764

    macro

    Hi
    The info you gave is insufficient.The attached book has macro which pulls all B12 values from all workbooks of the folder where you save this workbook. Tell us what do you want it compared with
    Ravi
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    07-22-2008
    Location
    ctown
    Posts
    35
    2)Can the closed file be opened for testing?
    The closed file can and will be opened periodically.

    3) Is there a fixed number of sheets in the closed file, and do they have a constant name?
    New sheets will be added to the file, but they will all start with 'Invoice' followed by their invoice # (e.g., Invoice29)

    4) What do you want to do with the result of the test?
    I have one file that contains a sheet (InventoryOut) with an array of Invoice #'s on the vertical axis and names of different rental items on the horizontal axis.
    Within this same file I have a sheet that is used as an Invoice template. What I mean by this is that it has all the columns with amount and type of rental and the formulas which automatically calculate the total dollar amounts. This sheet has a button that saves the sheet into a different workbook specifically for completed Invoices and then clears all the data just inputted so as to have an empty Invoice sheet again. This Invoice Sheet also contains a cell with an Invoice# in it that automatically goes up by one each time an invoice is saved.
    My next task is to add a macro to the save invoice button that matches the invoice# in the Invoice sheet to the corresponding row that contains the invoice# in InventoryOut. Then copy the rental amounts into their corresponding rental type column.
    After explaining my problem in more depth I think my original question is irrelevant, and my modified question is contained in the aforementioned paragraph.

    Any help would be greatly appreciated.
    Attached Files Attached Files

  5. #5
    Forum Contributor
    Join Date
    02-27-2008
    Posts
    764

    query

    Hi
    From the invoice sheet, which cells are to be picked to get Rentx,REnt y and rent z values for invoice out sheet
    Ravi

  6. #6
    Registered User
    Join Date
    07-22-2008
    Location
    ctown
    Posts
    35
    All cells under description will be either rental x,y, or z. I want to take the values from the quantity column and and put those quantities in the correct row and column of the InventoryOut sheet

  7. #7
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    You need to have save button that will post all relevant information to the inventory sheet, including the invoice number. You don't need to put the invoice numbers in un til they are used.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  8. #8
    Registered User
    Join Date
    09-16-2008
    Location
    Madrid, Spain
    Posts
    46
    I have a problem similar to this one and I think I can get my solution from here.

    Basically I have a master excel file where I want to import, on a daily basic, from different Excel files in a specific folder, from specified Cells.

    I want for example, on Master.xls, to import cells A1,B8,C9 from All the files in the folder c:\Documents\Reports\, to the cells A1, A2, A3 (in that order) in the main Master.xls

    Here is a schematic attached to show what i want in a visual way.
    Attached Images Attached Images

  9. #9
    Registered User
    Join Date
    09-16-2008
    Location
    Madrid, Spain
    Posts
    46
    Quote Originally Posted by ravishankar View Post
    Hi
    The info you gave is insufficient.The attached book has macro which pulls all B12 values from all workbooks of the folder where you save this workbook. Tell us what do you want it compared with
    Ravi
    I have taken this file and modified it to pull the information instead of from B12, to pull it from E76.

    This does exactly what I want it to do!!!

    What I want to change is basically to import the data E76 to A1, E77 to A2 and so on.

    ALSO, How can I make it so that it doesnt put in the cells the name of each file??

  10. #10
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Quote Originally Posted by cultavix View Post
    I have a problem similar to this one and I think I can get my solution from here.

    Basically I have a master excel file where I want to import, on a daily basic, from different Excel files in a specific folder, from specified Cells.

    I want for example, on Master.xls, to import cells A1,B8,C9 from All the files in the folder c:\Documents\Reports\, to the cells A1, A2, A3 (in that order) in the main Master.xls

    Here is a schematic attached to show what i want in a visual way.
    Start your own question and place a link to this one if you feel it will help. This is covered in the Forum Rules which you accepted on joining

  11. #11
    Registered User
    Join Date
    09-16-2008
    Location
    Madrid, Spain
    Posts
    46
    Oh ok, sorry about that!!! Since it was all the same you know...

  12. #12
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Quote Originally Posted by cultavix View Post
    Oh ok, sorry about that!!! Since it was all the same you know...
    It's not all the same, the Rules ask you not to hijack threads like this.

  13. #13
    Registered User
    Join Date
    07-22-2008
    Location
    ctown
    Posts
    35
    You need to have save button that will post all relevant information to the inventory sheet, including the invoice number. You don't need to put the invoice numbers in un til they are used.
    The problem with that solution is that I forsee having problems modifying a saved invoice, and still I'm not sure how to post all the relevant information into the correct columns, possibly with the FIND function.

    Any ideas?

  14. #14
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    If you have the numbers pre listed then you would need to use .Find to get the row number.

    I use Excel for invoicing & everything is contained within the one workbook - customer data, financial data. Backup c opies can be opened quickly. It's all possible with VBA, the main thing is planning first.

  15. #15
    Registered User
    Join Date
    09-16-2008
    Location
    Madrid, Spain
    Posts
    46
    who is hijacking the post? you can see i have only posted about 5 times. you told me about the rule, i accepted the rule, accepted responsibility and apologized and then i did what you told me to do and posted in a new thread.

    i will keep reading this because its exactly what i want to do, but ill ask my questions in "my thread"

  16. #16
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Quote Originally Posted by cultavix View Post
    who is hijacking the post? you can see i have only posted about 5 times. you told me about the rule, i accepted the rule, accepted responsibility and apologized and then i did what you told me to do and posted in a new thread.

    i will keep reading this because its exactly what i want to do, but ill ask my questions in "my thread"

    Read the rules,
    I am merely pointing out to you what you need to do - they are clear that you should not ask your question within another member's thread. I know you have started your own thread now, no one is bothered if you continue to read this one, that's not what I told you about.

    Your previous response to me was
    it was all the same you know...

  17. #17
    Registered User
    Join Date
    07-22-2008
    Location
    ctown
    Posts
    35
    I need to find the row with the invoice # and the column that contains the correct rental description. I'm using the array in InventoryOut to automatically update the inventory not just as a place to keep all the old invoice data.

+ 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. Multiple lines in single cell
    By Bill Pearce in forum Excel General
    Replies: 5
    Last Post: 04-02-2015, 10:59 AM
  2. Macro to Search column and if found, copy a cell within the worksheet
    By SKooT1027 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-16-2008, 01:12 PM
  3. multiple colors in same cell
    By Calman in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-29-2007, 02:02 AM
  4. Replies: 1
    Last Post: 06-19-2007, 11:58 AM
  5. Summing across multiple workbooks
    By andytan in forum Excel General
    Replies: 2
    Last Post: 09-28-2006, 01:44 AM

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