【发布时间】:2017-08-31 19:31:49
【问题描述】:
在 Excel VBA 中,我尝试遍历 Excel 表,然后更新该行中的另一列。我希望通过其名称而不是偏移量/数字来引用另一列,以防布局发生变化。这可能吗?
Dim rw As ListRow
Dim cl As Range
For Each rw In ActiveSheet.ListObjects("MasterData").ListRows
'Pseudo code:
if (rw[Notes] = "Test") then DO SOMETHING 'In this line I'd like to refer to the column called "Notes" but not sure how to do it.
Next rw
【问题讨论】: