1

您如何更正分配变量以存储对单元格的引用?最后一行抛出下标超出范围错误

Public Sub CommandButton1_Click()

Dim variance As Range
Dim risk As Range
Dim time As Range
Dim output As Range

variance = Sheets("ABC").Range("C6")
4

1 回答 1

2

Set variance = Sheets("ABC").Range("C6")

+

What is the difference between dim and set in vba

+

Subscript out of range means you do not have a sheet named ABC or the spelling/casing is different. Make sure it's not an Abc or ABc etc.

于 2013-09-27T10:46:53.240 回答