Hi all-
Why does the following code cause the run-time error unless I first select sheet(1)?
And, related, why does the following code work (no error) regardless of which sheet is selected?
I do not understand why hard coding the range with "a1:a3" should be different than using the "cells" method.
In both cases, I am using
I am using Excel 2003 SP3 with Windows XP.
-Jason
Why does the following code cause the run-time error unless I first select sheet(1)?
Code:
my_array = Sheets(1).Range(Cells(1, 1), Cells(3, 1)).Resize(3, 1)
Code:
my_array = Sheets(1).Range("a1:a3").Resize(3, 1)
In both cases, I am using
Code:
Dim my_array As Variant
ReDim my_array(1 To 3, 1)
-Jason