+ Reply to Thread
Results 1 to 3 of 3

Is there a way to choose a different starting position in a ForEach loop

  1. #1
    Registered User
    Join Date
    02-12-2020
    Location
    Amsterdam
    MS-Off Ver
    10
    Posts
    4

    Is there a way to choose a different starting position in a ForEach loop

    Hello all,

    Is there a way to start a ForEach loop at a given position in a range till the end and then continue from the start of the range to its initial starting point.
    I hope the image will make clear what I mean:

    B.png

    I'd like the loop to start at B13 to the end of the range B17 and then proceed from the start of the range B3 till its starting point B13
    This is just an example the starting point and length of the range varies.

    I tried the following but it seems that I am not able to choose the sequence

    Please Login or Register  to view this content.
    The desired outcome is: RESULT = 11,12,13,14,15,1,2,3,4,5,6,7,8,9,10

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,434

    Re: Is there a way to choose a different starting position in a ForEach loop

    Here is one way, by creating an array of the area to be processed

    Please Login or Register  to view this content.
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    02-12-2020
    Location
    Amsterdam
    MS-Off Ver
    10
    Posts
    4

    Re: Is there a way to choose a different starting position in a ForEach loop

    That worked, thanks Andy!!!!

+ 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. ISO Ideas for filling a table starting at position X
    By garden_gnome in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-21-2019, 12:02 PM
  2. [SOLVED] ForEach loop problem
    By peterschein in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-27-2019, 01:24 PM
  3. Playing an mp4 from a particular starting position
    By tantle1961 in forum Excel General
    Replies: 2
    Last Post: 05-11-2019, 11:35 PM
  4. Set scrollbars to a default starting position when a userform is initialized
    By Big_E in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-27-2014, 02:30 AM
  5. VBA Userform code and starting position
    By baltic in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-22-2014, 07:38 PM
  6. [SOLVED] Foreach loop lookup between two worksheets
    By asparak in forum Excel General
    Replies: 7
    Last Post: 07-14-2012, 05:03 AM
  7. Replies: 3
    Last Post: 06-12-2006, 11:30 PM

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