I have a spreadsheet that is exported from Kronos for employee timekeeping. The report often lists the employees name (in Column A) more than once because there are only 2 punches per line. The first punch is the start punch, the next punch is the punch for lunch. The second line normally has the punch back from lunch (if the employee leaves the building), followed by the end of shift punch. There are times were there are more lines for the same employee based on if the employee arrived late, left early, etc. I am trying to create a macro that will do the following...
* Check the number of times the name appears in Column A, line by line and display the value in Column C. So if A3 has a name that appears for the first time, the value in C3 would be 1. If A4 has the same name, the value in C4 would be 2, so for and so on until the end of the sheet. For every new name or non match in Column A, the value in Column C would go back to 1.
* If the value is 1 in Column C, Copy the values showing in Columns E and F of that same row and paste the information in I and J.
* If the value is 2 in Column C, Copy the values showing in Columns E and F of that same row and paste the information in K and L of the same row that has the value of 1 in Column C.
* If the value is 3 in Column C, Copy the values showing in Columns E and F of that same row and paste the information in M and N of the same row that has the value of 1 in Column C.
I am trying to place all of the punches on the same line so that a lookup from another sheet captures all of the punches and puts them in order as well. I already have the macro for the other sheet.
Please see attached example.
* Check the number of times the name appears in Column A, line by line and display the value in Column C. So if A3 has a name that appears for the first time, the value in C3 would be 1. If A4 has the same name, the value in C4 would be 2, so for and so on until the end of the sheet. For every new name or non match in Column A, the value in Column C would go back to 1.
* If the value is 1 in Column C, Copy the values showing in Columns E and F of that same row and paste the information in I and J.
* If the value is 2 in Column C, Copy the values showing in Columns E and F of that same row and paste the information in K and L of the same row that has the value of 1 in Column C.
* If the value is 3 in Column C, Copy the values showing in Columns E and F of that same row and paste the information in M and N of the same row that has the value of 1 in Column C.
I am trying to place all of the punches on the same line so that a lookup from another sheet captures all of the punches and puts them in order as well. I already have the macro for the other sheet.