+ Reply to Thread
Results 1 to 5 of 5

Referencing value from one excel file to another

  1. #1
    Registered User
    Join Date
    07-24-2007
    Location
    Oregon
    Posts
    79

    Referencing value from one excel file to another

    hi,

    I have two excel files. Say FileA.xls and FileB.xls.

    What I would like to do is to reference two columns (say E & F) from FileB to FileA. In short, if I change any values any value in Column E or F of FileB, it should reflect in FileA also.

    How can I achieve this?

    Ideally I would like to reference the entire worksheet of FileB to FileA.

    Thanks

  2. #2
    Forum Contributor
    Join Date
    03-13-2005
    Posts
    6,195
    Quote Originally Posted by modest_16081982
    hi,

    I have two excel files. Say FileA.xls and FileB.xls.

    What I would like to do is to reference two columns (say E & F) from FileB to FileA. In short, if I change any values any value in Column E or F of FileB, it should reflect in FileA also.

    How can I achieve this?

    Ideally I would like to reference the entire worksheet of FileB to FileA.

    Thanks
    Hi,

    I could not imagine why you would want this . . . but . . .


    You could have both Workbooks open and reference as =[FileB.xls]Sheet1!A1

    You could use a VLookup on the other (closed or open) workbook.

    You could install and use the MoreFunc Addin to allow you to use =[FileB.xls]Sheet1!A1 where the workbook may not be open.

    In any case, if BookC references BookA whilst BookA is closed the results will be unpredictable.

    hth
    ---
    Si fractum non sit, noli id reficere.

  3. #3
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229
    I think this will do what you want.
    In the code module of fileB.xls Sheet1
    Please Login or Register  to view this content.
    In a normal code module:
    Please Login or Register  to view this content.
    Any change to Columns E and F of sheet1 of fileB.xls will be reflected in those columns of Sheet1 in FileA.xls

    Calling dupSheet instead of dupRange will duplicate all of Sheet1 from fileB to fileA.

  4. #4
    Registered User
    Join Date
    07-24-2007
    Location
    Oregon
    Posts
    79
    Quote Originally Posted by mikerickson
    I think this will do what you want.
    In the code module of fileB.xls Sheet1
    Please Login or Register  to view this content.
    In a normal code module:
    Please Login or Register  to view this content.
    Any change to Columns E and F of sheet1 of fileB.xls will be reflected in those columns of Sheet1 in FileA.xls

    Calling dupSheet instead of dupRange will duplicate all of Sheet1 from fileB to fileA.

    I tried as you suggested but I could not get it working. I am sure I am doing something wrong or didn't understood it correctly. I am attaching the two files with the code in it as you suggested. That may probably give you more idea as to what I did wrong.

    I really appreciate your efforts. Thanks a lot.

    Please see the attached file.
    Attached Files Attached Files

  5. #5
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229
    The Private Sub Worksheet_Change should be in the code module for BookB, sheet1, not in the normal module it currently is.

+ 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