Hi Everybody,
1) I am trying to reduce the number of functions calls in a loop (from 4 to one);
2) If possible, I also wish to find an alternative to “Application.Index” calls. Please advise.
Please look at the following --
(In short: we are transposing a vertical worksheet region into a four-consecutive-columns in a certain row of a VBA two-dimentional variant array)
I wish to replace these four calls with a more efficient code (maybe executing one call instead of four).
I’ve tried placing “Array(1,2,3,4)” at the row index of Application.Index but failed (probably did it wrong).
I am not experienced in VBA. I hope one of the members will be able to provide a hint.
1000 THX
1) I am trying to reduce the number of functions calls in a loop (from 4 to one);
2) If possible, I also wish to find an alternative to “Application.Index” calls. Please advise.
Please look at the following --
(In short: we are transposing a vertical worksheet region into a four-consecutive-columns in a certain row of a VBA two-dimentional variant array)
Excel Formula:
' STORE worksheet's four results into vba array: varTests
varTests(t, 2) = Application.Index(wrkshtMAIN.Range("rgn?RunScore"), 1, 1)
varTests(t, 3) = Application.Index(wrkshtMAIN.Range("rgn?RunScore"), 2, 1)
varTests(t, 4) = Application.Index(wrkshtMAIN.Range("rgn?RunScore"), 3, 1)
varTests(t, 5) = Application.Index(wrkshtMAIN.Range("rgn?RunScore"), 4, 1)
I wish to replace these four calls with a more efficient code (maybe executing one call instead of four).
I’ve tried placing “Array(1,2,3,4)” at the row index of Application.Index but failed (probably did it wrong).
I am not experienced in VBA. I hope one of the members will be able to provide a hint.
1000 THX