Hi,
I've just discovered that assigning values from cells or a range of cells to single variables or arrays can be simply done by following code:
[VBA]
Sub AssigningValues ()
Dim a, b, c, d
a = [A1] 'single value referring to cell A1
b = [A1:A10] '2D array
c = [transpose(A1:A10)] '1D array
d = [test] 'in case cell A1 has name "test"
End sub
[/VBA]
Now, this looks a better method to me, than using
[VBA].Cells(1,1)[/VBA]
or
[VBA].Range("A1").Value[/VBA]
Can anyone tell me if this method is faultless? Or do I have to take into account some surprises?
Thx.