Excel: Replace INDIRECT() to dynamically refer to

2019-06-08 18:15发布

I have a sheet with lots of INDIRECT() functions to pull data from other sheets in the same workbook. Something like

=INDIRECT(SheetName&"!A1")

I've realized that INDIRECT() is a volatile function so it re-calculates every time when any change is made in any workbook. This makes Excel very slow especially when there are several workbooks opened.

Is there any other function that could replace INDIRECT() to lookup with dynamic sheet name?

2条回答
我只想做你的唯一
2楼-- · 2019-06-08 18:46

Lisa: You can use CHOOSE in association with a lookup table to replace INDIRECT. See the screenshot in my answer to this question: Excel Vlookup with cell reference

Also, check out my answer at Excel tables vs plain data where I give a bit of info on how you can address the root cause of your slow spreadsheet.

查看更多
做自己的国王
3楼-- · 2019-06-08 18:50
  • Turn of automatic calculculations (strongly not advisable)
  • Build a UDF function, that is non-volatile by default:

Public Function IndirectNotVolatile(sheetName As String, sheetRange As Range) as Variant
    Set IndirectNotVolatile = Worksheets(sheetName).Range(sheetRange.Address)
End Function
查看更多
登录 后发表回答