【发布时间】:2015-03-05 17:14:19
【问题描述】:
我为 2 个范围内的产品编写了代码。其中一个范围在其他范围内,当我试图使其可变时,出现了一些错误。这是代码:
Sub Correlacionar()
Dim col As Integer
Dim random As Range
Dim SDesv As Range
Dim Chole As Range
col = 4
Set Chole = Sheet4.Range("a20:d23")
'Set Chole = Sheet4.Range(Cells(20, 1), Cells(19 + col, col))
Set random = Range(Cells(3, 9), Cells(3, 8 + col))
Set SDesv = Range(Cells(10, 1), Cells(10, col))
SDesv = WorksheetFunction.MMult(random, WorksheetFunction.Transpose(Chole))
Application.CutCopyMode = False
End Sub
我想使用:
Set Chole = Sheet4.Range(Cells(20, 1), Cells(19 + col, col))
代替:
Set Chole = Sheet4.Range("a20:d23")
【问题讨论】:
-
您收到的错误是什么?也许您可以在问题中添加一些示例数据。