Results 1 to 9 of 9

Nested Do Until loop with multiple variables

Threaded View

  1. #1
    Registered User
    Join Date
    07-25-2019
    Location
    Application(Earth).Country(USA)
    MS-Off Ver
    v14 32bit
    Posts
    16

    Nested Do Until loop with multiple variables

    Hi, I am a very new user of VBA. I am attempting to nest a loop inside another loop. I am not certain of the correct formatting for nesting the inner loop, and how to declare the variables of the inner loop. I am not certain if a For each loop should be used instead of a Do Until loop for the inner loop.

    I would like for the a b c d variables to increment together as a+1 b+1 c+1 and d-1 with each inner loop cycle.
    I would like to initialize a as 1, b as 1, c as 2, and d as 2 with the ability to change this initialization.
    I would like to print the outcome to Cells(i, 17).


    Thanks in advance for your kind consideration. I would really appreciate any help you may offer. Thank you.



    .bas file attached
    notepad copy of code attached
    spreadsheet before attached
    spreadsheet after attached (runs with my program as shown in the .bas file. Problem is, the program becomes very long and exceeds 64kb and thus I want to loop the repetitive part of it as described in the .bas file)

    Thank you!
    Attached Files Attached Files
    Last edited by tonypizza; 07-29-2019 at 05:53 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Define multiple variables with loop
    By jakopak in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-29-2016, 03:33 PM
  2. [SOLVED] Multiple Variables in For Each Loop
    By Excel Guy 123 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-16-2014, 11:47 PM
  3. Replies: 1
    Last Post: 05-12-2014, 10:25 PM
  4. Nested For Each loop for 2 range variables
    By artur.serra in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-03-2013, 10:34 AM
  5. [SOLVED] Nested FOR loop from multiple FOR loops
    By Chilton in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 3
    Last Post: 08-15-2012, 11:36 AM
  6. Sum multiple nested loop entries
    By dems in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-31-2010, 09:09 AM
  7. For each loop nested; getting stuck on one cell in first iteration of nested loop
    By Excel_vba in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-22-2009, 11:54 AM

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