使用单元格参考输入单元格? [英] Using a cell reference entered into a cell?

查看:141
本文介绍了使用单元格参考输入单元格?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在单元格K1中,VBA插入基于vba代码中概述的某些条件而更改的单元格引用。

In cell K1 VBA inserts a cell reference that changes based on certain conditions outlined in the vba code.

这个例子让我们说这个单元格的值是$ A $ 13

For this example lets say the value of this cell is $A$13

现在在单元格K2中我想它等于K1中提供的细胞参考。

Now in cell K2 I want it to equal what ever is in cell reference provided by K1.

所以换句话说,如何在excel公式中使用单元格K1中提供的单元格引用,因为当我有按= K1我收到单元格的值,即$ A $ 13,而不是单元格$ A $ 13的值

So in other words how do I use the cell reference provided in cell K1 in excel formulas because when ever I press =K1 I receive the value of the cell i.e. $A$13 and not the value of cell $A$13

推荐答案

使用函数 INDIRECT()

=INDIRECT(K1)

但请注意: INDIRECT()这是一个挥发性的功能,这意味着由于参考的不确定性,它将会更频繁地重新计算。对于较轻的工作簿,这没有任何问题。然而,对于更复杂,更重的工作簿,这可能会大大减慢计算。消除所有调用 INDIRECT()之后,看到工作簿需要3-4 +分钟才能打开只需花费约5秒才能打开。

Please note this however: INDIRECT() is a volatile function, meaning that it will recalculating more often than necessary because of the uncertainty of the reference. For lighter workbooks this poses no problem. However, for more complex, heavier workbooks this can heavily slow the calculations. I have seen workbooks take 3-4+ minutes to open only to take ~5 seconds to open after eliminating all calls to INDIRECT().

这篇关于使用单元格参考输入单元格?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆