Hi again,
First things first. How do you rename the buttons to @btn??? That really puzzles me! Can the module be put in the "personal" workbook and run from there?
The modButtonClick Print code works really well. I just had to add : PrintFOC iSheetNum + 1 , because when I click on the first button it would print the first sheet. Obviously! But, the first sheet is the CHECKLIST, so the +1 fixed it. Now Button 1 prints sheet 2, button 2, sheet 3, etc. AWESOME!
I gave the filter code addittion a test run and it gives an error "438 : object not supported by this property or method" on the line of code:
I noticed in the code that iCount is 1 to 17. Should that be 2 to 18 because they're the sheets that I want to print?
I do apologize if I haven't explained my self very well so I'll give it another go.
Filter looks in column A for a result of less than 6 (being 6 weeks to go before the job is finished).
When it finds an agreeable result in a row (A3, A6, A9, A12.......A48, A51) it opens a new workbook with one sheet and adds the row to the new worksheet. (eg. if A9<6 then A9:W9 will be copied in its entirety to the new workbook/worksheet)
The filter then continues through "JOB CHECKLIST A", if it finds no results, closes, and opens "JOB CHECKLIST B" , filters, closes, opens, and so on for all files in the folder.
I believe that bit is already understood.
Where the checklist is concerned, the Job number is more or less irrelevant.
Job Numbers in Column B are linked to the Checklists like this:
Sheet 1 = CHECKLIST
Sheet 2 = Tab #1. This sheet is associated with B3 (Row 3)
Sheet 3 = Tab #2. This sheet is associated with B6 (Row 6)
Sheet 4 = Tab #3. This sheet is associated with B9 (Row 9)
.......
Sheet18 = Tab #17. This sheet is associated with B51 (Row 51)
Back to our previous example (and hopefully the part containing the explaination):
If the filter found "JOB CHECKLIST A" cell A9<6 then Sheet 4 should be printed.
If the filter found "JOB CHECKLIST B" cell A3<6 then Sheet 2 should be printed.
If the filter found "JOB CHECKLIST C" cell A51<6 then Sheet 18 should be printed.
I have attached 2 completed workbooks that hopefully will go a long way to clearing things up.
I quickly looked through them and there should be a total of 11 results found between the 2 workbooks (according to filter criteria).
Thanks for your time with this,
Regards,
Martin
Bookmarks