Results 1 to 6 of 6

"invalid next control variable reference" While trying to compile.

Threaded View

  1. #1
    Registered User
    Join Date
    09-01-2022
    Location
    Holstebro, Denmark
    MS-Off Ver
    Office 365
    Posts
    9

    Question "invalid next control variable reference" While trying to compile.

    I'm trying to make a Multiple Solver using VBA in excel to make my work go faster.
    I cant seem to figure out what i'm doing wrong even tho this should be super simple. (relative new to VBA and Excel)
    I think the error has something to do with my "For i" and my "Next i"=?
    Hope someone can hlep me out!

    PHP Code: 
    Sub MultipleSolver()
    Dim i As Integer
    Dim o 
    As Integer
    ActivateWorkbook
    .ActivateSheet.Activate
    For 36 To 37
    For 39 To 51
    SolverReset
    SolverOk SetCell
    :="$C$" iMaxMinVal:=3ValueOf:=0ByChange:="$H$" o
    SolverSolve True
    Next i
    Next o

    End Sub 
    Last edited by Juhl94; 09-01-2022 at 10:25 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 11
    Last Post: 12-19-2019, 04:46 PM
  2. [SOLVED] Why am i getting "Compile error: Invalid ReDim"
    By welchs101 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-05-2017, 11:58 AM
  3. [SOLVED] VBA Noob, "Compile Error: Invalid Use of Property" On First line of Code (great..)
    By tvwright in forum Excel Programming / VBA / Macros
    Replies: 23
    Last Post: 10-20-2015, 05:00 PM
  4. Changed code and now get " Invalid next control variable reference
    By b_rianv in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-31-2014, 05:19 PM
  5. Compile error: Invalid Next control varibale reference
    By baig123 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-03-2014, 06:51 AM
  6. [SOLVED] Debugging - Compile error: Invalid Next control variable reference
    By xxgirlinbluexx in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-26-2013, 08:14 AM
  7. Compile Error: Invalid Next Control Variable Reference
    By mlegge04 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-25-2012, 02:38 PM

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