+ Reply to Thread
Results 1 to 4 of 4

Loop through range, and create a new sheet

  1. #1
    Registered User
    Join Date
    09-13-2010
    Location
    Norway
    MS-Off Ver
    Excel 2007
    Posts
    6

    Loop through range, and create a new sheet

    Hi all!

    Please see the attachment.

    I am working on an hour list sheet where I would like to use some VBA to automate it.
    The content on sheet 1 is filled in manually.

    The content on the next sheet is a bit more fuzzy. In addition to the Example.xls, there is a bit more info to be put, but I hope I can manage to clear things up if someone could help with with the basics

    As you see, when "Traveling hours" and "Working hours" is happening at the same date, a new line is made.
    However, when Working time and overtime is happening at the same date, they end up at the same line (but different column.)

    Hopefully, you see the idea of the sheets, and may help me out with the the basics of the script.

    How would I go through looping this situation?
    Is anyone able to show me an example script on how you would collect data from a range, implement the data to a new sheet, then go back to the first range (but on a new date) and repeat this all over?

    Help is much appreciated!
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Loop through range, and create a new sheet

    Hi

    Extremely fixed in terms of ranges, but hopefully it will give you some ideas.

    Please Login or Register  to view this content.
    rylo
    Last edited by rylo; 09-16-2010 at 12:33 AM. Reason: added comments

  3. #3
    Registered User
    Join Date
    09-13-2010
    Location
    Norway
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Loop through range, and create a new sheet

    Thank you very much for your reply Rylo!

    Now, as the newbie I am, I'm trying to figure out what you'v done here.
    My eyes are going back and fourth between your reply, and my ...for Dummies book :D

    I am maybe putting too much into this, as I am gonna include lots of calculation into this (ex. start time-end time, 50% overtime, 100% overtime, is it sunday etc..) And then scratching my head over your work!

    But would you be kind to do some commenting within the loop? That is the Achilles-heel.

    If not, thank you anyway!
    Your help is much appreciated, and hopefully I will figure my macro out in the end

  4. #4
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Loop through range, and create a new sheet

    Hi

    I've put some comments into the code in post #2. See if they help. If not, then don't hesitate to come back with questions.

    rylo

+ 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