Check Pattern with VBA

ejpoke

New Member
Joined
Apr 24, 2017
Messages
6
EMP IDEMP Name
DateJobJOB #
1
John1/1/17Manager1
1John1/2/17Manager1
1John1/3/17Employee2
2Mary1/1/17Employee2
2Mary1/2/17Employee2
3Peter1/3/17Manager1
4Paul1/4/17Employee2

<tbody>
</tbody>


Hello all-

I am creating a converter for payroll files pulled from POS data. I need to write a VBA code that checks that the same employee is clocked in as the same job for the date range. So in this example Employee #1 John is the only employee in violation because during this period he has two unique jobs (Manager and Employee). I would like a msgbox to pop up stating that employee #1 John is in violation of the policy so the person entering data can fix the incorrect entry manually. Some employees will have only 1 row (just one day of working ilke Peter and Paul) some will have multiple (like Mary and John). The report pulls with both a numerical and string value for each employee and job type.

Appreciate any feedback!
 

ejpoke

New Member
Joined
Apr 24, 2017
Messages
6
Wanted to bump this back up.

My gut is to concatenate columns A and E then run a loop to see if there are any discrepancies. So any concatenated "code" that starts with 1 should be followed by more 1's than 2's. Please let me know if I am approaching this the right way

Thanks!
 

Forum statistics

Threads
1,081,417
Messages
5,358,553
Members
400,503
Latest member
RedSquirrel

Some videos you may like

This Week's Hot Topics

  • VBA (Userform)
    Hi All, I just would like to know why my code isn't working. Here is my VBA code: [CODE=vba]Private Sub OKButton_Click() Dim i As Integer...
  • List box that changes fill color
    Hello, I have gone through so many pages trying to figure this out. I have a 2020 calendar that depending on the day needs to have a certain...
  • Remove duplicates and retain one. Cross-linked cases
    Hi all I ran out of google keywords to use and still couldn't find a reference how to achieve the results of a single count. It would be great if...
  • VBA Copy and Paste With Duplicates
    Hello All, I'm in need of some input. My VBA skills are sub-par at best. I've assembled this code from basic research and it works but is...
  • Macro
    is it possible for a macro to run if the active cell value is different to the value above it
  • IF DATE and TIME
    I currently use this to check if date has passed but i also need to set a time on it too. Is it possible? [CODE=vba]=IF(B:B>TODAY(),"Not...
Top