+ Reply to Thread
Results 1 to 5 of 5

Update cells whose source is in a closed workbook

  1. #1
    Registered User
    Join Date
    01-28-2010
    Location
    Sydney
    MS-Off Ver
    Excel 2003
    Posts
    30

    Update cells whose source is in a closed workbook

    I wish to create a simple macro which will update a range of cells D4:K32.
    These cells use a VLookup function to find data in another workbook.
    Basically, I want to refresh their numbers since each day, the source workbook may change.
    I do not want to have to open to source workbook.

    Currently I have this code. Note, the workbook I'm updating cells for is called "Estimates" and the source workbook I have name "file" and is in the directory O:\E\K.

    Please Login or Register  to view this content.
    This pretty much opens the workbook then presses "Enter" on each cell in Estimates to refresh them.

    Is there a better way to do this?

    Refresh links?
    Using special code which does the same action without the source workbook opening?

    Thanks!

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Update cells whose source is in a closed workbook

    Hi,

    Why do you need to do anything at all other than accept and say yes to the links being updated whenever you open the Estimates book?

    If you allow the links to update any changes that have been made in the 'file' source workbook will be reflected in Estimates.

    Regards
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    01-28-2010
    Location
    Sydney
    MS-Off Ver
    Excel 2003
    Posts
    30

    Re: Update cells whose source is in a closed workbook

    Quote Originally Posted by Richard Buttrey View Post
    Hi,

    Why do you need to do anything at all other than accept and say yes to the links being updated whenever you open the Estimates book?

    If you allow the links to update any changes that have been made in the 'file' source workbook will be reflected in Estimates.

    Regards
    Hi Richard,

    My concern was that in the estimates workbook I have a cell where I ask the user to enter a date. From this date, the VLookup searches for the approriate data in the closed workbook, "file".

    So changing the date in this cell didn't update the links in estimates since file was closed.

    However, I just highlighted all the cells with a VLookup, clicked Edit --> Links --> selected "file" --> Update links

    Does this now mean that whenever I change the date in the cell that the VLookups will automatically grab the right data, since they're linked to the closed workbook?
    Essentially, I wouldn't need a macro at all if this were the case...

  4. #4
    Registered User
    Join Date
    01-28-2010
    Location
    Sydney
    MS-Off Ver
    Excel 2003
    Posts
    30

    Re: Update cells whose source is in a closed workbook

    It appears linking the cells works I didn't know this existed until now. I love excel :D

  5. #5
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Update cells whose source is in a closed workbook

    Hi,

    Yes, that's about it.

    Of course every time you open Estimates you'll be prompted to update the links so there's no need to highlight and update, and you don't need a macro.

    Regards

+ 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