Macro to copy several items based on several conditions and paste on specific cells of another workbook

gxa08

New Member
Joined
Jun 21, 2018
Messages
1
Hi there,

I'm need of some help please, as I'm currently having to track and compile all the data mentioned below manually.

Here is the situation:

I have a workbook with several sheets. Each sheet contains a weeks worth of punch times for several employees. The data on each sheet is always formatted the same. This is what it contains:
DivDeptManagerEmployeeIDPunch TypeDayDateTime
29999PETERS, JOHNSMITH, JOE1234Clock InSat06/09/201813:23
29999PETERS, JOHNSMITH, JOE1234Clock OutSat06/09/201819:11
29999JONES, JAMESJOHNSON, PAUL2345Clock InSat06/09/201806:29
29999JONES, JAMESJOHNSON, PAUL2345Going to MealSat06/09/201812:33
29999JONES, JAMESJOHNSON, PAUL2345Back From MealSat06/09/201813:31
29999JONES, JAMESJOHNSON, PAUL2345Clock OutSat06/09/201815:32
29999PETERS, JOHNSMITH, JOE1234Clock InSun06/10/201811:30
29999PETERS, JOHNSMITH, JOE1234Going to MealSun06/10/201817:26
29999PETERS, JOHNSMITH, JOE1234Back From MealSun06/10/201818:21
29999PETERS, JOHNSMITH, JOE1234Clock OutSun06/10/201820:34
29999SMITH, AMBERGARCIA, JOSE3456Clock InSun06/10/201811:34
29999SMITH, AMBERGARCIA, JOSE3456Going to MealSun06/10/201814:05
29999SMITH, AMBERGARCIA, JOSE3456Back From MealSun06/10/201815:06
29999SMITH, AMBERGARCIA, JOSE3456Clock OutSun06/10/201820:28
29999PETERS, JOHNPAUL, ROBERT4567Clock InSun06/10/201811:27
29999PETERS, JOHNPAUL, ROBERT4567Going to MealSun06/10/201816:05
29999PETERS, JOHNPAUL, ROBERT4567Back From MealSun06/10/201817:05
29999PETERS, JOHNPAUL, ROBERT4567Clock OutSun06/10/201820:27

<tbody>
</tbody>


Ideally I would like to have the macro look for each name on the employee column, the day, date, and punch type, then paste the clock in, meals, and clock out onto another workbook on specific cells. This is what the other workbook looks like:

Schedule
Day of WeekDateClock InLunch Break TakenClock OutScheduled Time InLunch BreakScheduled Time Out
Saturday6/9/20186:30:001:00:0015:30:00
Sunday6/10/2018
Monday6/11/2018
Tuesday6/12/20186:30:001:00:0015:30:00
Wednesday6/13/20186:30:001:00:0015:30:00
Thursday6/14/20186:30:001:00:0015:30:00
Friday6/15/20186:30:001:00:0015:30:00

<tbody>
</tbody>


On this second workbook, I have a sheet for each employee. Each sheet contains the data above for a whole quarter. From here, I have formulas that give me the difference between the clock in, lunch break, clock out versus what the employee is schedule.

Sorry, I know is a lot and probably super confusing. Any thoughts, ideas, suggestions will be greatly appreciated.
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.

Forum statistics

Threads
1,214,940
Messages
6,122,361
Members
449,080
Latest member
Armadillos

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top