ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Indirect addressing (https://www.excelbanter.com/excel-programming/436686-indirect-addressing.html)

GC

Indirect addressing
 
Hello,

I have 2 variables called sys1 and sys2. I need to assign values to these 2
variables within a loop.
i.e.
For X = 1 to 2
sys(X) = CurrentSystemValue
Next

What is the correct syntax. I tried "sys "& X and that did not work.

Thanks in advance,
Cheers!




Jacob Skaria

Indirect addressing
 
You cannot do that unless sys is an array.

Dim sys(2) as Variant
For X = 1 to 2
sys(X) = CurrentSystemValue
Next


If this post helps click Yes
---------------
Jacob Skaria


"GC" wrote:

Hello,

I have 2 variables called sys1 and sys2. I need to assign values to these 2
variables within a loop.
i.e.
For X = 1 to 2
sys(X) = CurrentSystemValue
Next

What is the correct syntax. I tried "sys "& X and that did not work.

Thanks in advance,
Cheers!



.



All times are GMT +1. The time now is 05:31 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com