简体   繁体   English

Excel VBA动态范围/索引选择

[英]Excel VBA Dynamic Ranges/Index selections

I'm trying to create a talent calculator for myself, and the entire first sheet calls to a Data sheet that does all the background work. 我正在尝试为自己创建一个人才计算器,并且整个第一个工作表都调用一个执行所有后台工作的数据表。 On the excel sheet itself, everything calls to INDEX(TableName,Row,Column) because it's much easy to keep track of and I find I often have to move data around while working on it so handling Names is easier than handling cell references. 在Excel工作表本身上,所有东西都调用INDEX(TableName,Row,Column),因为它很容易跟踪,而且我发现我在处理它时经常不得不四处移动数据,因此处理名称比处理单元格引用更容易。

However, I also use VBA on this sheet, and I'm rather new to it. 但是,我在此工作表上也使用了VBA,这是我的新手。 Instead of, for example, using Range("C1"), if C1 was part of table TableOne, would there be a way to reference it like in the Excel formulas such as INDEX(TableOne,1)? 如果C1是表TableOne的一部分,而不是例如使用Range(“ C1”),是否可以像Excel公式(如INDEX(TableOne,1))中那样引用它?

Instead of Range, you can simply use Worksheets(...).Cells(row, column) , or if TableOne is a named Range, then Range("TableOne").Cells(row, column) . 可以使用Worksheets(...).Cells(row, column)代替Range,或者如果TableOne是命名的Range,则可以使用Range("TableOne").Cells(row, column) I'm not all sure if that's all you need... 我不确定是否就是您所需要的...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM