Leeward904
New Member
- Joined
- May 5, 2021
- Messages
- 12
- Office Version
- 2019
- Platform
- Windows
Hello all i apologize if this has been asked previously i wasn't having any luck finding the right macro for my need.
As a project manager i have to provide a "Contract Status Report" once a month to my customer and my supervisor fills out a daily production form, a new work sheet is added for each day, and it is always located in the same location for each job. At the end of the month i need to pull the latest daily production form and include it in my "Contract Status Report" and i have my project master file set up to retrieve the labor hours report, material cost report, apply the correct rates to the various cost elements, and the file even uses the labor report to create a "employee roster" for all employees that have worked on the job. The last this thing i need to do is write a macro to have the master file go to a cell referenced location, find the .xls file title "DCR", open it (or not it makes no difference to me), copy all data from from the last worksheet in the file (the supervisor has a bad habit of naming the sheets different names each time), copy the latest daily report to the worksheet in the master file title "Progress Report", and finally close the DCR without saving (unless it didnt open in the first place).
That was really wordy so this might make it easier:
1. Macro assigned to "button" on master file- Click
2. Master file goes to cell referenced (on master file worksheet "Data" Range("A27")) location to locate file titled "DCR.xls"
3. Find the last worksheet in DCR file and copies all data
4. paste DCR worksheet data to worksheet in master file titled "Progress Report" (preferably keeping the DCR file formatting)
5. close without saving DCR file
I am new to VBA and any help is greatly appreciated!!!
As a project manager i have to provide a "Contract Status Report" once a month to my customer and my supervisor fills out a daily production form, a new work sheet is added for each day, and it is always located in the same location for each job. At the end of the month i need to pull the latest daily production form and include it in my "Contract Status Report" and i have my project master file set up to retrieve the labor hours report, material cost report, apply the correct rates to the various cost elements, and the file even uses the labor report to create a "employee roster" for all employees that have worked on the job. The last this thing i need to do is write a macro to have the master file go to a cell referenced location, find the .xls file title "DCR", open it (or not it makes no difference to me), copy all data from from the last worksheet in the file (the supervisor has a bad habit of naming the sheets different names each time), copy the latest daily report to the worksheet in the master file title "Progress Report", and finally close the DCR without saving (unless it didnt open in the first place).
That was really wordy so this might make it easier:
1. Macro assigned to "button" on master file- Click
2. Master file goes to cell referenced (on master file worksheet "Data" Range("A27")) location to locate file titled "DCR.xls"
3. Find the last worksheet in DCR file and copies all data
4. paste DCR worksheet data to worksheet in master file titled "Progress Report" (preferably keeping the DCR file formatting)
5. close without saving DCR file
I am new to VBA and any help is greatly appreciated!!!