It seems that I can't use an auxiliary variable (L4 for example) in a For...Next loop. However, when I try to use a user defined variable then I can't get the FormulaCalc function to recognise it. Thus, neither of the following two blocks of code seem to work:
L1 = 11
For L4 = L1-1 to (L1-2)*2
Call FormulaCalc("Ch(L4) = -Ch(L4)")
Next
L1 = 11
For ChnCount = L1-1 to (L1-2)*2
Call FormulaCalc("Ch(ChnCount):=-Ch(ChnCount)")
Next
but as a workaround the following block of code does seem to work:
L1 = 11
For ChnCount = L1-1 to (L1-2)*2
L4 = ChnCount
Call FormulaCalc("Ch(L4):=-Ch(L4)")
Next
but this seems lengthy and messy. Is there a more appropriate way?
Thanks, Si.