I wrote a code for a product between 2 ranges. One of those ranges is in other and when i have tried to make it variable, appear some mistake. This is the code:
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
I want to use:
Set Chole = Sheet4.Range(Cells(20, 1), Cells(19 + col, col))
Instead of:
Set Chole = Sheet4.Range("a20:d23")