Hello,
I'm writing a VBA program and receive "run-time error 13: type mismatch"
In the code below the line in bold receives the error.
For clarification, FactorMA(nEMA) is an array of about 2 possible values a and b.
I have all parts of the line defined as variables and I use that calculation as a constant in the next line.
Can somebody tell me why I receive this error?
Thanks.
I'm writing a VBA program and receive "run-time error 13: type mismatch"
In the code below the line in bold receives the error.
Rich (BB code):
<code> Let FactornEMA(nEMA) = 2 / (FactorMA(nEMA) + 1) 'run-time error 13: type mismatch
Let Cells(1 + nData, colEMA(nEMA)) = FactornEMA(nEMA) * (Cells(1 + nData, 4) - Cells(nData, 4)) </code><code> </code><code>Else
End If</code>
I have all parts of the line defined as variables and I use that calculation as a constant in the next line.
Can somebody tell me why I receive this error?
Thanks.
Last edited: