Results 1 to 3 of 3

Basic to VBA Excel 2007 Let statement

Threaded View

  1. #1
    Registered User
    Join Date
    08-01-2012
    Location
    Washington, USA
    MS-Off Ver
    Excel 2007
    Posts
    1

    Basic to VBA Excel 2007 Let statement

    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’
    Last edited by Cutter; 08-01-2012 at 02:38 PM. Reason: Added code tags

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1