How does referencing cells in another workbook work?

JumboCactuar

Well-known Member
Joined
Nov 16, 2016
Messages
788
Office Version
  1. 365
Platform
  1. Windows
Hi,
Just want an understanding on how excel pulls values from another workbook when you reference in a formula like this:

Code:
=SUM(D:\Reports\[Sales.xlsx]Jan!B2:B5)

As on our network drive at work, a 30mb spreadsheet would be fairly slow to open, yet you can pull values from it almost instantly with the formula.
 
Last edited:

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
a 30mb spreadsheet would be fairly slow to open, yet you can pull values from it almost instantly with the formula

Yes, but the values in the workbook containing the linked formulas only get updated under certain conditions, e.g.

1) You click the Update button when opening the workbook;
2) You force the values to be updated, via Data --> Edit Links --> Update Values;
3) You enable automatic update of links on startup; or
4) The linked workbook is open at the same time (and in the same Excel instance pre-2013 version).
 
Last edited:
Upvote 0
Yes, but the values in the workbook containing the linked formulas only get updated under certain conditions, e.g.

1) You click the Update button when opening the workbook;
2) You force the values to be updated, via Data --> Edit Links --> Update Values;
3) You enable automatic update of links on startup; or
4) The linked workbook is open at the same time (and in the same Excel instance pre-2013 version).

Can't you just delete the formulas and re add them with VBA?
 
Upvote 0
Not sure I see your point... If you delete and re-add the formulas, you're still restricted by the same items above.

sorry if i wasn't clear but if for example i run the following macro:
Code:
Sub Macro2()
Dim Sht As String


Sht = Range("Z1")


    Range("A2:B1000").Cells.ClearContents
    
    Range("A2").FormulaR1C1 = "='C:\test\[mytest.xlsb]" & Sht & "'!R[4]C21"
    Range("A2").AutoFill Destination:=Range("A2:A1000"), Type:=xlFillDefault
    
    Range("B2").FormulaR1C1 = "='C:\test\[mytest.xlsb]" & Sht & "'!R[4]C18"
    Range("B2").AutoFill Destination:=Range("B2:B1000"), Type:=xlFillDefault


    Range("A2:B1000").Value2 = Range("A2:B1000").Value2
End Sub

it instantly grabs the values a lot quicker than opening the workbook to view them, im guessing excel can load them differently.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,894
Messages
6,175,254
Members
452,624
Latest member
gregg777

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top