+ Reply to Thread
Results 1 to 13 of 13

Loop through Array then Offset Range by given Value

  1. #1
    Registered User
    Join Date
    09-17-2020
    Location
    sydney
    MS-Off Ver
    365
    Posts
    36

    Loop through Array then Offset Range by given Value

    How do I use a loop to offset a range on each looped Array?
    This is what I have:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    But then I need to offset A5:AD5 by a row value of 4 each time it completes a loop. Any ideas ?

  2. #2
    Registered User
    Join Date
    09-17-2020
    Location
    sydney
    MS-Off Ver
    365
    Posts
    36

    Re: Loop through Array then Offset Range by given Value

    To better explain my problem I have this:-

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    This is poo, lol if i were to complete it like this i'd have to do that 30 more times :S

  3. #3
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,516

    Re: Loop through Array then Offset Range by given Value

    Should be like
    Please Login or Register  to view this content.

  4. #4
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,598

    Re: Loop through Array then Offset Range by given Value

    A string array of, say, 30 range addresses starting from "A5:AD5" and incrementing by four:
    Please Login or Register  to view this content.


    Please Login or Register  to view this content.
    Last edited by protonLeah; 09-24-2022 at 12:02 AM.
    Ben Van Johnson

  5. #5
    Registered User
    Join Date
    09-17-2020
    Location
    sydney
    MS-Off Ver
    365
    Posts
    36

    Re: Loop through Array then Offset Range by given Value

    Thanks everyone for the replies. One last question though.
    How do I increase this by 1?

    Formula: copy to clipboard
    Please Login or Register  to view this content.

  6. #6
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,516

    Re: Loop through Array then Offset Range by given Value

    What do you mean by
    How do I increase this by 1?

  7. #7
    Registered User
    Join Date
    09-17-2020
    Location
    sydney
    MS-Off Ver
    365
    Posts
    36

    Re: Loop through Array then Offset Range by given Value

    Quote Originally Posted by jindon View Post
    What do you mean by
    Ah crap my apologies that was written wrong lol.
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    I want linerng(1) to increase by 1

  8. #8
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,516

    Re: Loop through Array then Offset Range by given Value

    Is it related to the code I posted? or new question?

    Anyway your code doesn't make sense to me, so you need to explain what you are really trying to do in words.

  9. #9
    Registered User
    Join Date
    09-17-2020
    Location
    sydney
    MS-Off Ver
    365
    Posts
    36

    Re: Loop through Array then Offset Range by given Value

    No this is a new code but part of the bigger picture.
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Lol my apologies again i have no idea how to word or describe it

  10. #10
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,516

    Re: Loop through Array then Offset Range by given Value

    then perhaps
    Please Login or Register  to view this content.

  11. #11
    Registered User
    Join Date
    09-17-2020
    Location
    sydney
    MS-Off Ver
    365
    Posts
    36

    Re: Loop through Array then Offset Range by given Value

    unfortunately it doesn't work

  12. #12
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,516

    Re: Loop through Array then Offset Range by given Value

    "Doesn't work" is the worst response.

    How is it not working?

    Since you are posting just a part of the code one by one, it is too hard to even guess.

  13. #13
    Registered User
    Join Date
    09-17-2020
    Location
    sydney
    MS-Off Ver
    365
    Posts
    36

    Re: Loop through Array then Offset Range by given Value

    You changed the post to from

    Set linerngints(iee) = Application.Inersect(myRange, linerng(i))
    to
    Set linerngints(iee) = Application.Inersect(myRange, linerng(iee))

    But yes (iee) does work XD thankyou for being patient.

+ 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. [SOLVED] Look up id and add data for a range for the said id and offset in a loop or anything coole
    By Kelly mort in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 01-02-2020, 05:37 AM
  2. Populate Countif values (Offset) into Array and loop through it
    By mchilapur in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-16-2017, 05:55 AM
  3. [SOLVED] Help with: Range Array SelectCase Loop delete: Array All Sheet.Names
    By dlow in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-08-2015, 07:11 PM
  4. [SOLVED] Need Help With Offset Using Named Range Loop in VBA
    By mrdintx2014 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-19-2014, 01:47 AM
  5. Replies: 1
    Last Post: 01-23-2013, 03:00 PM
  6. [SOLVED] Loop Through A Range, Find Cells > 1, Copy Offset To Another Sheet
    By bugmenot in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-25-2008, 06:30 PM
  7. [SOLVED] Need offset range for loop
    By Joe Fish in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 10-16-2005, 09:05 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