I am working with a VBA Excel 2007 code that someone in my office years ago converted from a GW-Basic program. I can get the program to run up to this statement. I have tried to transpose the formula to see if an alternative method might be acceptable with no success. I have broken the Let statement in two parts, and had the program to run, but I need the entire expression.
I know Let is an old expression from Basic and is not used much in VBA any more. Any suggestions would be appreciated.
‘Beginning of the Program
Sub Shaw()
Dim dftrt(120), Y(120), Z(120)
Dim C(12), V(12), U(12), R(12, 12)
Dim W(12, 10), S(12), T(12)
Dim P(12, 12), A2(12), B(12), Q(12)
Dim D(10, 12), E(10, 12)
Dim F(12)
‘Subsequent statements
Let A = (S(M) / H) ^ 2
Let B2 = T(M) / H - (S(M) / H) ^ 2
Let C2 = Sqr((T(M) / H) - (S(M) / H) ^ 2)
Let C(M) = C
Let S2 = S2 + (S(M) / H)
Let V(M) = (C(M) / (Sqr(H))) ^ 2 ‘This is problem area that is producing ‘Run-time error 13 type mismatch’
Bookmarks