Pascalvrolijk
Board Regular
- Joined
- May 28, 2004
- Messages
- 68
Hi all, i would like to ask your help on this. Been trying, been googling but didnt get it yet..
In Excel I named cell A1 as: selected_fund and I named cells A5:A10 as fundnames.
So in VBA I want to do a for loop as follows:
for i=1 to 6
[selected_fund].value=[fundnames](i).value
...
next i
This should result in A1=A5.value, then A1=A6.value, ..., then A1=A10.value.
If I replace [fundnames](i).value by [A5], [A6], ..., [A10] it works fine of course, but i want to use reference to an element in an array/matrix.
however i get an error on [fundnames](i).value: "incorrect number of arguments or incorrect property assignment"
Who can help me out to make the reference to an element in [fundnames]?
Thanks in advance,
Kind regards,
Pascal.
In Excel I named cell A1 as: selected_fund and I named cells A5:A10 as fundnames.
So in VBA I want to do a for loop as follows:
for i=1 to 6
[selected_fund].value=[fundnames](i).value
...
next i
This should result in A1=A5.value, then A1=A6.value, ..., then A1=A10.value.
If I replace [fundnames](i).value by [A5], [A6], ..., [A10] it works fine of course, but i want to use reference to an element in an array/matrix.
however i get an error on [fundnames](i).value: "incorrect number of arguments or incorrect property assignment"
Who can help me out to make the reference to an element in [fundnames]?
Thanks in advance,
Kind regards,
Pascal.