+ Reply to Thread
Results 1 to 8 of 8

Auto Macro the pulls data from on sheet, prints on another sheet, then deletes information

  1. #1
    Registered User
    Join Date
    03-04-2013
    Location
    Fort Worth, Texas
    MS-Off Ver
    Excel 2010
    Posts
    14

    Auto Macro the pulls data from on sheet, prints on another sheet, then deletes information

    I've created a log that will keep track of miles driven on 5 cars for the month. Unfortunately, I have never learned how to write macros.

    I've attached my file and on the first sheet "INFO FOR WHAT I NEED!" is what I'm looking for.

    Basically what I'm looking for is a macro to run the 1st of every month that will take the Overall Total in each vehicles sheet and print the data in the sheet "Monthly Mileage" in the month that just ended.
    Example: March 1st will print in February; April 1st will print in March

    After the data has been printed the mileage breakdown will need to be deleted.

    I also have an extra that I will like but is not needed and that is to count how many time the mileage is recorded for the month and printed on the "Checked out vs. Rec" sheet under the recorded section.

    I know this is a lot to me, not really sure about you, but any help is greatly appreciated.
    Attached Files Attached Files

  2. #2
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,517

    Re: Auto Macro the pulls data from on sheet, prints on another sheet, then deletes informa

    This should do it
    Please Login or Register  to view this content.
    Last edited by mike7952; 03-06-2013 at 01:10 PM.
    Thanks,
    Mike

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved.

  3. #3
    Forum Contributor
    Join Date
    12-31-2012
    Location
    Jhang, Pakistan
    MS-Off Ver
    Excel 2010
    Posts
    250

    Re: Auto Macro the pulls data from on sheet, prints on another sheet, then deletes informa

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    03-04-2013
    Location
    Fort Worth, Texas
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: Auto Macro the pulls data from on sheet, prints on another sheet, then deletes informa

    Thank you both for the responses. Where would I place this code at in the doc?

  5. #5
    Forum Contributor
    Join Date
    12-31-2012
    Location
    Jhang, Pakistan
    MS-Off Ver
    Excel 2010
    Posts
    250

    Re: Auto Macro the pulls data from on sheet, prints on another sheet, then deletes informa

    Press Alt+F11 to open Visual Basic for Applications.... Click Insert-->Module.... and paste the code in the module window... Save the workbook as "Excel Macro-Enabled Workbook".

    Whenever you need to call the macro... Press Alt+F8 and click "Run"

  6. #6
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,517

    Re: Auto Macro the pulls data from on sheet, prints on another sheet, then deletes informa

    See attached. Click button to run. or see comment to the right of button.
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    03-04-2013
    Location
    Fort Worth, Texas
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: Auto Macro the pulls data from on sheet, prints on another sheet, then deletes informa

    All I can say is wow mike. It is amazing what y'all can do. Works great.

    Just wondering but is there a way to make it run automaticly on the first day of the month?

  8. #8
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,517

    Re: Auto Macro the pulls data from on sheet, prints on another sheet, then deletes informa

    Yes but there are many issues that you would need to address. I wouldn't recommend it. I would use the button to process when I was ready.
    1 issue is if the workbook is not opened on the first. macro wouldn't run.
    2 issue is what if your behind in the log and you open the workbook on the first of the month?

    It can be done, but had to code on unknown If's that could arise? That's why I would recommend to use the button.

+ 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