+ Reply to Thread
Results 1 to 5 of 5

Help with nested loops

  1. #1
    Registered User
    Join Date
    11-12-2009
    Location
    surrey
    MS-Off Ver
    Excel 2003
    Posts
    22

    Cool Help with nested loops

    I’ll try and shorten the task to its smallest part as each source row has 52 columns and I have 1000’s of row to reformat.

    I need to copy data from
    sheet1 Row1 columns ABCD to sheet2 row 1 and repeat like this
    Row1 columns ABCE to sheet2 row 2
    Row1 columns ABCG to sheet2 row 3

    then go to next row (2) in sheet 1 and repeat
    Row2 columns ABCD to sheet2 row 4 and repeat like this
    Row2 columns ABCE to sheet2 row 5
    Row2 columns ABCG to sheet2 row 6

    I've started with the code below then really got stuck with how to procede. Any help would be greatly appreciated.
    Please Login or Register  to view this content.
    Last edited by wishmaker; 04-23-2013 at 10:43 AM. Reason: Solved

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643
    The description and the code don't really seem to match.

    Could you attach a sample workbook?
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    11-12-2009
    Location
    surrey
    MS-Off Ver
    Excel 2003
    Posts
    22

    Re: Help with nested loops

    Please find sample file attached

    Regards
    John

    John_Budgets to be imported.xlsm

  4. #4
    Registered User
    Join Date
    11-12-2009
    Location
    surrey
    MS-Off Ver
    Excel 2003
    Posts
    22

    Re: Help with nested loops

    Solved the problem but it runs a bit slow...

    Please Login or Register  to view this content.

  5. #5
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Help with nested loops

    I tried that code in the uploaded workbook and it's super fast, that's mainly because it doesn't appear to do anything.

    Am I missing something?

    By the way, I still don't quite see how the code matches the description.

    The code is copying column 4 from one sheet to columns 1, 3-7 on another, copying column 12 to columns 2 and 8, columns 6 and 7 to columns 11 and 12, columns 5 and 8 to columns 13 and 14 and putting 'Range' in column 9.

    The rows being copied are also a bit strange.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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