I have a planning worksheet (sheet1) with number of vba codes (command buttons) that performs various task. I am now trying to add another function which is to extract and generate a 4 weeks summary (Sheet3) from sheet1 anytime the command button is clicked.
This is how the code on sheet3 will work:
1- Extract all task (excluding workers column) from sheet1 and paste to sheet3
2- Extract ONLY four weeks (from today) from sheet1 and paste it to sheet3.
3- Extract weekdata (all "7.5") into sheet3 so that for every "7.5" it will be "1" in a single cell in a task row in sheet3. For example, if there are 3 men (rows) under a task (7.5 hours) on Monday, it should be "3" in a single cell corresponding to the day of the week in Sheet3. In other words, write the total number of men that work that day in Sheet3.
4- Print sheet3 to PDF, etc.
The step I am having problem is the 3rd step. I have tried various ways to write the code section , but its not working, the closest one I did was this code below, (Note this is only working for one week, one task (Order 9427) as an example, I could not also figure how to adapt it to work for all the task and workers in sheet1). I attached the worksheet showing this for clarification
Bookmarks