+ Reply to Thread
Results 1 to 7 of 7

Macro to copy a sheet for each weekday of the month and rename it as such.

  1. #1
    Forum Contributor
    Join Date
    01-09-2016
    Location
    USA,USA
    MS-Off Ver
    2016
    Posts
    1,192

    Macro to copy a sheet for each weekday of the month and rename it as such.

    I have to send a daily log of what reports my team did for the previous day. So My team logs it all on one page and just builds on top of the previous days. This fine and works, but I would really like a cleaner and easier way. right now I have to copy and paste the log for each auditor into one sheet. Not difficult, its only six people right now, but that's not the point! Another concern I have is that by the end of the month, you will have to scroll a little ways to get to the bottom of the sheet.

    So I have two options, one I can make 30 individual sheets and each day they update that single one and then I can just send that one sheet off. Or, they just add to a sheet each day and I have to sweep it for the previous day.

    If I go with option 1, can I run a macro that will make a copy 30 times and rename it with the dates of the month? It would be easiest if it could identify the month without editing the macro, or if a popup asked for which month and only did weekdays. (this way if I am not the party to run the report, someone else would be able to manage it and not need to edit a macro)

    Attached is the report i use. Totals is the sheet with the whole month, and Sheet1 would be what would copy over in order to send yesterday's activities.
    Attached Files Attached Files

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,925

    Re: Macro to copy a sheet for each weekday of the month and rename it as such.

    Would you consider a variation to the way you have the data organized on Totals?

    Instead of having a name for each auditor going across the top would you consider having columns A to E

    A = Auditor's Name
    B = Date
    C = Category
    D = Call Type
    E = Name of Audit

    With a setup like this, we could use a pivot table to get yesterday's data with summary information at the top or maybe a second page such as number of audits done by an auditor, types of audits done, etc.

    Then we can copy the results of the pivot table to a report file with the appropriate date stamp.

    If you are concerned about data entry on the Totals page (having scroll down too far), I can arrange that on a page activate event, focus will be placed on the first open line at the bottom of the page and even autofill it with the current date. Since you have 2010, then the formulas, validations, etc. would copy down automatically.

    There would be no need for 30 separate pages or copy and paste for the report. It will happen at the click of a button.

    I have a question about data entry. How is the data entered? Does each auditor do his/her own entry and if so, how do you give them concurrent access to the workbook?

    Would it work for you it each auditor got a daily workbook and filled in the information for that day? At the end of the day, the auditor puts the book in a "Pending" folder. The main worksheet has a program that reads the folder and extracts information from the workbooks and moves them to a "Completed" folder.

    The Main workbook will have the capability to generate the daily workbooks for the auditors by name and with date stamp. E.g. Audits-Joe 161101. The workbook would then be primed to autofill the correct date in the date column and auditor name in the Name column. Each auditor would only have to deal with 5 columns of data, and the book will be primed on the last row for data entry.

    This would also keep auditors from messing with each other's data (unless they open the wrong book).

    So, at the end of the day, you would punch a button on the main sheet and it would gather information from the workbooks in the pending folder and create a workbook in the pending folder for each of your current auditors. The auditors fill the books out in place (meaning in the pending folder) and save and close them the following day.

    I already have a project that does this kind of thing so I have the process worked out.
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

  3. #3
    Forum Contributor
    Join Date
    01-09-2016
    Location
    USA,USA
    MS-Off Ver
    2016
    Posts
    1,192

    Re: Macro to copy a sheet for each weekday of the month and rename it as such.

    It is a shared workbook. So I think doing the A:E would cause overlapping concerns right? Don't know whose is currently typing in A1 or A3?

  4. #4
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,925

    Re: Macro to copy a sheet for each weekday of the month and rename it as such.

    In that case, all bets are off. You can't use macros in a shared workbook.

  5. #5
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,925

    Re: Macro to copy a sheet for each weekday of the month and rename it as such.

    What I am proposing is that at the end of the day you click a button and it does the following:

    It gathers up all the workbooks in the Pending Folder and processes them: it collects and consolidates the data in the master workbook and moves the files to the processed or completed folder for auditing purposes and to make sure you don't double count anything.

    It takes the new data and it makes a "This is what we did today" report that you can send off.

    It creates new daily files for each auditor with the auditor's name and date stamp for the next day and puts them in the pending folder so they can fill them out.

    This will be the point of failure: if an auditor leaves the file open or doesn't save it. The program is going to work with the latest file that is saved to the disk. I'll check around to see if there is a way to at least detect this condition and warn you.

    I can further suggest that if you have administrative rights to your machine that you can schedule the machine do all this at say, 10 PM at night at a time when you are certain that the auditors are done with their work and get the new day's files out in plenty of time for them in the morning. Your report will be waiting for you first thing in the morning so all you have to do is review it and send it to your boss.

  6. #6
    Forum Contributor
    Join Date
    01-09-2016
    Location
    USA,USA
    MS-Off Ver
    2016
    Posts
    1,192

    Re: Macro to copy a sheet for each weekday of the month and rename it as such.

    That sounds great, but i don't trust my people to not screw it up. End up adjust name change, skipping a row and then the macro thinks it is done. etc...

    Your solution is giving too much credit to them!

    I have another shared workbook I combine all their data. What I do is copy it and unshare it and run my macro so I can do the pivots i need too and not worry about screwing with their data.

  7. #7
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Macro to copy a sheet for each weekday of the month and rename it as such.

    Hi taylorsm

    Play with the Code in the attached. Click the "Show Form" Button. You'll need to sort out the Sharing Issue.
    Attached Files Attached Files
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

+ 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 sheet, rename with name and month increment
    By julhs in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-20-2016, 12:13 PM
  2. Replies: 0
    Last Post: 02-09-2016, 03:04 PM
  3. Macro to copy sheet, then rename month name, then filter the results by that name
    By jateelover in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-01-2014, 05:31 PM
  4. Replies: 0
    Last Post: 06-28-2014, 02:26 PM
  5. Macro to duplicate current sheet and incrementally rename by month
    By jerrydiaz in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-05-2013, 12:31 PM
  6. Replies: 4
    Last Post: 08-16-2013, 04:10 AM
  7. copy worksheet from previous month and rename to current month
    By Dan E. in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-08-2005, 05:45 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