Tag: variant

Excel VBA – 使用.cells属性错误将范围分配给变体,

我有下面的代码提取下面, Dim profileRange as Variant profileRange = ActiveWorkbook.Worksheets("Scenario").Range(Cells(1, "C"), Cells(5, "C")) 然后在expression式中得到以下内容 Watch Expression: profileRange Value: Empty Type: Variant/Empty 它应该得到在该表中分配的数字…从1到5 另外,我在运行代码时得到了这个 Error 1004: Application or Object defined error 有人可以帮忙吗?