+ Reply to Thread
Results 1 to 5 of 5

Cannot get loop within a loop to work

  1. #1
    Forum Contributor
    Join Date
    06-06-2013
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    181

    Cannot get loop within a loop to work

    Hi All,

    I am trying to get the below code to work how I want it to work. I have tried various things to try and resolve the issue.

    Please Login or Register  to view this content.
    Basically, in cell A1 to A10 I have values going from Q1 to Q10. I then want to copy Cell A1 (i.e. value ="Q1") and paste it into 5 times into Cells D1 to D5, then I want to copy cell A2 (Value = "Q2") and copy and paste it in cells D6 to D10, then A3 into D11 to D15 and so on until I reach cell A10 (Value = Q10).

    The code above, unfortunately just means it keeps recording in cells D1 to D5.

    Any help would be greatly appreciated.

    Kind regrads,

    forrestgump

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,211

    Re: Cannot get loop within a loop to work

    Please Login or Register  to view this content.

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,088

    Re: Cannot get loop within a loop to work

    Is it ??

    Please Login or Register  to view this content.
    - Battle without fear gives no glory - Just try

  4. #4
    Forum Contributor
    Join Date
    06-06-2013
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    181

    Re: Cannot get loop within a loop to work

    Thanks this works great. I am just looking up the resize function so I understand more.

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,211

    Re: Cannot get loop within a loop to work

    You're welcome. Thanks for the rep.

+ 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] Copy dynamically changing column and Paste using VBA Loop (Loop within Loop)
    By nixon72 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-12-2013, 12:46 PM
  2. New Tabs for each run of a loop does not work!!!
    By danitouffaha in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-16-2012, 04:57 PM
  3. loop does not work correctly
    By fredagamie@gmail.com in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-22-2006, 07:30 PM
  4. [SOLVED] Why this basic LOOP does not work!
    By GreenInIowa in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-02-2005, 06:17 PM
  5. MarkerStyle Loop won't work
    By JFamilo in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-02-2005, 12:13 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