novice_2010
Board Regular
- Joined
- Mar 18, 2010
- Messages
- 105
I have following codes:
I got a Type Mismatch error for the line in red. How to re-write this line of code? (ArrayVariable is a variable that contains a 5 by 1 array)Sub test()
Dim ArrayVariable As Variant
Range("A1").Resize(1, 5).Name = "Range_Name_1"
Range("A5").Resize(5, 1).Name = "Range_Name_2"
Range("G1").Formula = "=mmult(Range_Name_1, Range_Name_2)"
Range("G2").FormulaArray = "=mmult(Range_Name_1, transpose(Range_Name_1))"
ArrayVariable = Range("A5").Resize(5, 1).Value
Range("J1").FormulaArray = "=mmult(Range_Name_1," & ArrayVariable & ")"
End Sub