+ Reply to Thread
Results 1 to 3 of 3

change variable on every iteration in loop

  1. #1
    Forum Contributor
    Join Date
    12-06-2012
    Location
    sacramento,calif
    MS-Off Ver
    Excel 2010
    Posts
    217

    change variable on every iteration in loop

    Is there a way to cycle through the variables? Example below. Also when all the variables are cycled through, how to exit the loop?



    Please Login or Register  to view this content.

  2. #2
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP, 2007, 2024
    Posts
    16,525

    Re: change variable on every iteration in loop

    Instead of individual variables, use an array:
    Please Login or Register  to view this content.
    https://msdn.microsoft.com/en-us/library/wak0wfyt.aspx or put "using arrays in VBA" into your favorite internet search engine.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  3. #3
    Forum Contributor
    Join Date
    12-06-2012
    Location
    sacramento,calif
    MS-Off Ver
    Excel 2010
    Posts
    217

    Re: change variable on every iteration in loop

    works, thanks.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. jump to xth iteration of for next loop
    By ammartino44 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-25-2015, 12:07 PM
  2. [SOLVED] Last Iteration of Loop?
    By saintplay in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-17-2015, 08:19 PM
  3. [SOLVED] Loop fails on 2nd iteration
    By capson in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-14-2014, 01:38 PM
  4. Continue next iteration of For loop
    By Excel_vba in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-22-2013, 02:09 AM
  5. [SOLVED] For loop and change a variable
    By amotto11 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 02-11-2013, 02:48 PM
  6. How do I loop to change variable names?...
    By fjdurbin in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-04-2011, 03:50 PM
  7. Advancing to the next iteration of a loop?
    By Maury Markowitz in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-02-2005, 01:06 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