+ Reply to Thread
Results 1 to 4 of 4

Help with making formula that allows me to use data from an unopened worksheet

  1. #1
    Registered User
    Join Date
    11-06-2013
    Location
    San Diego, CA
    MS-Off Ver
    Excel 2013
    Posts
    2

    Help with making formula that allows me to use data from an unopened worksheet

    Hello!

    I am fairly new at this, so please forgive me.

    I am trying to make a worksheet that will insert data from other worksheet that are saved on my computer. These files are all saved as "Ticket #3405", where the number changes with each ticket. The next file is saved as "Ticket #3405" and so on. I want to create a main worksheet that takes all the pertinent info from these worksheets and automatically inserts them. Essentially, I need to write the ticket# in a column on this main worksheet and have all the info populate other fields in this worksheet. How do I make the worksheet access info from saved spreadsheets on my computer? And how do I make the formula change to access the correct spreadsheet when I type in the ticket #?

    Thank you,

    Brandon

  2. #2
    Forum Contributor
    Join Date
    03-21-2013
    Location
    Corvallis, OR
    MS-Off Ver
    Excel 2010
    Posts
    174

    Re: Help with making formula that allows me to use data from an unopened worksheet

    Unfortunately, there is no way to indirectly reference cells in a closed workbook, but with the consistency in file names and locations, it is possible to accomplish this through the use of a macro in the worksheet change event. Try this:

    Please Login or Register  to view this content.
    This code assumes that the main worksheet that you want the formulas in is saved in the same location as the ticket files themselves. If that is not the case, you will need to change the path as appropriate. It also assumes that the ticket numbers you enter are in column A. Insert this code into the sheet where you enter the ticket numbers, and it will create a formula to the right of the ticket number as you enter it that references the value in cell A1 of that ticket number. All of these parameters can be changed by changing the parts of the code that are : FrmlaCl = Cells(Target.Row, Target.Column + 1).Address to put the formula in a different cell, or Sheet1'!$A$1" to reference a different location in the ticket spreadsheet. It also assumes that the ticket spreadsheets are saved in the .xlsx format. If not, you would need to change "".xlsx]" to whatever format it is, whether ".xls" or ".xlsm" or any other excel format...

    I hope this helps.
    Last edited by bmxfreedom; 11-06-2013 at 09:19 PM. Reason: left that msgbox path checker in there by accident...

  3. #3
    Registered User
    Join Date
    11-06-2013
    Location
    San Diego, CA
    MS-Off Ver
    Excel 2013
    Posts
    2

    Re: Help with making formula that allows me to use data from an unopened worksheet

    Thanks! This will be very helpful once I fully understand it. A few questions,

    1)If the main worksheet is not saved in the same location as the ticket files, how can I change the path as appropriate?
    2)How can I change the FrmlaCl = Cells(Target.Row, Target.Column + 1).Address part of the formula to move it away from column A

    Thank you!

  4. #4
    Forum Contributor
    Join Date
    03-21-2013
    Location
    Corvallis, OR
    MS-Off Ver
    Excel 2010
    Posts
    174

    Re: Help with making formula that allows me to use data from an unopened worksheet

    All of the code in this workbook relies on the files being in the same location, though you could just replace ThisWorkbook.Path with the path of the ticket files.
    The frmlaCl can be distanced from column A by changing Target.Column + 1 to Target.column + 2, for 2 columns away (C), or 3 for 3 columns away (D), or you can get rid of Target.Column completely, and just specify whatever column number you want; i.e., if you want the formula in column F, replace "Target.Column + 1" with the number 6.

+ 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. Macro copying data from unopened worksheet to open worksheet
    By chriswiec in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-01-2013, 02:14 PM
  2. [SOLVED] Importing unopened worksheet into an open Workbook
    By GrayesGhost in forum Excel General
    Replies: 25
    Last Post: 07-01-2006, 02:25 PM
  3. [SOLVED] Getting data from unopened spreadsheet
    By Kaval in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-09-2006, 04:10 AM
  4. [SOLVED] Testing an unopened (or opened) worksheet for VBA Project protected
    By Ken Loomis in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-18-2005, 08:18 AM
  5. [SOLVED] How can I embed a file as an unopened object in a worksheet or wo.
    By Goat Boy in forum Excel General
    Replies: 2
    Last Post: 01-04-2005, 08:06 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