+ Reply to Thread
Results 1 to 8 of 8

Problem with loop

  1. #1
    Registered User
    Join Date
    02-23-2014
    Location
    Hjørring, Denmark
    MS-Off Ver
    Excel 2010
    Posts
    16

    Problem with loop

    I am new to VBA in Excel and need help in looping. I have different data from a sheet "PakkeIndtag" that I need to copy to different cells in other sheet "Data". My loop works almost perfectly. One thing I can't find out is how to jump over row 46 which is in the end of mu loop.If you look at the uploaded picture 1, you can see that I need to come over row 46 then it repeats all over again. The next yellow row will come at row 89 and so on, and so on, every 43 rows. Everything in-between yellow rows is the same as shown on the image.

    My code is as follows
    Please Login or Register  to view this content.
    I hope somebody can help me with this problem
    Attached Images Attached Images
    Last edited by Leith Ross; 02-23-2014 at 04:21 PM. Reason: Added Code Tags

  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,506

    Re: Problem with loop

    What would you have us do with a picture of a worksheet?

    If it were my call, I'd move the subtotal(s) from their location in-line to the right hand side perhaps on the last row of the Sunday block.


    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
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Problem with loop

    hi Dedaluss, welcome to Excelforum,

    option basing on the code provided (not tested due no sample file have been presented)

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    02-23-2014
    Location
    Hjørring, Denmark
    MS-Off Ver
    Excel 2010
    Posts
    16

    Re: Problem with loop

    Hi watersev,

    thx for quick reply. I have to disappoint you but code you provided those not work. Maybe it would be easy if I upload portion of the file i'm working on, so you can try it out.

    Best Regards
    Dedaluss
    Attached Files Attached Files

  5. #5
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Problem with loop

    please check attachment, press Run button or run code in Module 2
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    02-23-2014
    Location
    Hjørring, Denmark
    MS-Off Ver
    Excel 2010
    Posts
    16

    Re: Problem with loop

    Hi Watersev

    You've done it. It works perfectly. Now do you think that i could take same code, copy it, and use it like this one, just to take data from other sheets and put it on same Data sheet?

    I appreciate all your help. Please tell me if I have added reputation on to your account. This was my first reply with problem solved

    Best regards
    Dedaluss

  7. #7
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Problem with loop

    I can't answer your question. The easiest way to check that is to use this code on a different sheet of the file.

    PS. Re reputation: it was successful

  8. #8
    Registered User
    Join Date
    02-23-2014
    Location
    Hjørring, Denmark
    MS-Off Ver
    Excel 2010
    Posts
    16

    Re: Problem with loop

    Thx a lot
    PROBLEM SOLVED

    Best Regards
    Dedaluss

+ 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. Vlookup problem in a loop with cell property and variable cell problem (long title sry)
    By ExcelsiorLux in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-13-2013, 10:38 AM
  2. [SOLVED] Loop inside a loop problem!
    By questionguy in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-22-2012, 12:54 PM
  3. Loop problem
    By Rams in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-01-2011, 09:50 AM
  4. For Each Next Loop Problem
    By jdbegg in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 12-20-2006, 10:52 PM
  5. Problem adding charts using Do-Loop Until loop
    By Chris Bromley in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-23-2005, 09:06 AM

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