+ Reply to Thread
Results 1 to 7 of 7

Copying data from external workbook into current workbook based on cell value

  1. #1
    Forum Contributor
    Join Date
    01-23-2010
    Location
    Suffolk, England
    MS-Off Ver
    Office 365
    Posts
    220

    Copying data from external workbook into current workbook based on cell value

    Hi,

    I've got a table of data which has to be refreshed from data held externally in another workbook.

    The key steps would be;

    1. The source financial data is held externally at an address that can change and I want to be able to state its location as a variable in the current workbook.

    2. The data to be refreshed would exist in a specified range both in the current and external workbooks.

    3. The process of refreshing data would use the cell value in a column of the range, one row at a time.

    4. With each matching current workbook cell value, the corresponding row would be found in the external workbook and two values would be copied from specified columns on that row into specified columns in the current workbook.

    I haven't got a clue how to start this and my research in the forum hasn't really helped because of my level of VBA experience.

    Any help is much appreciated.

    Thanks,

    Louise
    Last edited by Brontosaurus; 10-07-2012 at 11:18 AM.

  2. #2
    Valued Forum Contributor
    Join Date
    03-17-2012
    Location
    Warsaw, Poland
    MS-Off Ver
    2007/2010
    Posts
    555

    Re: Copying data from external workbook into current workbook based on cell value

    Hi there,

    I've got a minute to spare and would like to help you. I don't know about others, but it would help me to get a working code for you, if you'd attach both workbooks (with some indication what goes where etc.).

    Thanks
    If you think that my answer was helpful, please click on the "Add to this user's Reputation" button.

  3. #3
    Forum Contributor
    Join Date
    01-23-2010
    Location
    Suffolk, England
    MS-Off Ver
    Office 365
    Posts
    220

    Re: Copying data from external workbook into current workbook based on cell value

    Hi,

    Thanks for taking a look. The two workbooks are attached;

    Variance Chart Current is the open workbook which contains the destination fields (yellow) for the financial data copied from the external workbook Financial Data (also yellow).

    The Financial Data workbook address is highlighted in red and fields to be matched are in green.

    I hope this makes sense.

    Thanks,
    Louise
    Attached Files Attached Files

  4. #4
    Valued Forum Contributor
    Join Date
    03-17-2012
    Location
    Warsaw, Poland
    MS-Off Ver
    2007/2010
    Posts
    555

    Re: Copying data from external workbook into current workbook based on cell value

    Please Login or Register  to view this content.
    Please let me know if this does the job.

  5. #5
    Forum Contributor
    Join Date
    01-23-2010
    Location
    Suffolk, England
    MS-Off Ver
    Office 365
    Posts
    220

    Re: Copying data from external workbook into current workbook based on cell value

    Hi,

    Thanks for the code. I forgot to tell you that there are more rows of data in the "Financial Data" workbook than in the "Variance" workbook and I just want to copy across when there's a match with those fields stated in the Variance workbook.

    Is this a simple modification to the code in your reply?

    Best wishes,

    Louise

  6. #6
    Valued Forum Contributor
    Join Date
    03-17-2012
    Location
    Warsaw, Poland
    MS-Off Ver
    2007/2010
    Posts
    555

    Re: Copying data from external workbook into current workbook based on cell value

    Does this imply that there is not always a match and the code has returned an error for you? Because I don't see a problem if there are more rows in "financial data" as long as the searched cell value is among them (or I'm missing something here).

  7. #7
    Forum Contributor
    Join Date
    01-23-2010
    Location
    Suffolk, England
    MS-Off Ver
    Office 365
    Posts
    220

    Re: Copying data from external workbook into current workbook based on cell value

    Hi, that's absolutely superb and so elegantly designed.

    Thank you so very much.

    Best wishes,

    Louise

+ 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