SophieF114
New Member
- Joined
- Aug 14, 2019
- Messages
- 7
Hi all,
I have used this forum to find answers for years and always found what I was looking for without even having to post my question. But this time I am stuck, proably because I don't knwo what exactly to search for.
Let me explain what I am trying to achieve first:
I am analysing employes expenses claims based on an extract I get out of our online expense portal. The aim here is to identify employees with multiple claims in a single week and summarise in a list who it is, how many lines (items) per claim and the total value of the claim. Below is an example extract from the source file. Column SHKZG defines what each row is, "S" is a line (item) and H is the total for a claim. and column WRBTR is the amount per line or claim. So employee one stayed in a hotel for 4 nights and paid £70 each night, and the total claim was £280.
[TABLE="class: grid, width: 738"]
<tbody>[TR]
[TD]HED[/TD]
[TD]SGTXT[/TD]
[TD]SHKZG[/TD]
[TD]WRBTR[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD]530683 - EMPLOYEE ONE - HOTEL[/TD]
[TD]S[/TD]
[TD="align: right"]70[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD]530684 - EMPLOYEE ONE - HOTEL[/TD]
[TD]S[/TD]
[TD="align: right"]70[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD]530685 - EMPLOYEE ONE - HOTEL[/TD]
[TD]S[/TD]
[TD="align: right"]70[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD]530686 - EMPLOYEE ONE - HOTEL[/TD]
[TD]S[/TD]
[TD="align: right"]70[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD]115860 - EMPLOYEE ONE - TOTAL[/TD]
[TD]H[/TD]
[TD="align: right"]280[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD]531727 - EMPLOYEE TWO - HOTEL[/TD]
[TD]S[/TD]
[TD="align: right"]80[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD]531728 - EMPLOYEE TWO - DINNER YOU ONLY[/TD]
[TD]S[/TD]
[TD="align: right"]14.47[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD]531729 - EMPLOYEE TWO - MEALS - LUNCH (ATTENDEES)[/TD]
[TD]S[/TD]
[TD="align: right"]11.53[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD]531730 - EMPLOYEE TWO - MEALS - LUNCH (ATTENDEES)[/TD]
[TD]S[/TD]
[TD="align: right"]12.48[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD]531731 - EMPLOYEE TWO - MEALS - LUNCH (ATTENDEES)[/TD]
[TD]S[/TD]
[TD="align: right"]7.98[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD]531732 - EMPLOYEE TWO - BREAKFAST YOU ONLY[/TD]
[TD]S[/TD]
[TD="align: right"]1.49[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD]116041 - EMPLOYEE TWO - TOTAL[/TD]
[TD]H[/TD]
[TD="align: right"]127.95[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD]530928 - EMPLOYEE THREE - BUSINESS MILEAGE - PRIVATE CAR[/TD]
[TD]S[/TD]
[TD="align: right"]153[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD]530930 - EMPLOYEE THREE - HOTEL[/TD]
[TD]S[/TD]
[TD="align: right"]60[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD]115902 - EMPLOYEE THREE - TOTAL[/TD]
[TD]H[/TD]
[TD="align: right"]213[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD]530981 - EMPLOYEE FOUR - HOTEL[/TD]
[TD]S[/TD]
[TD="align: right"]67.5[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD]530983 - EMPLOYEE FOUR - HOTEL[/TD]
[TD]S[/TD]
[TD="align: right"]66[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD]530984 - EMPLOYEE FOUR - DINNER YOU ONLY[/TD]
[TD]S[/TD]
[TD="align: right"]15[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD]115905 - EMPLOYEE FOUR - TOTAL[/TD]
[TD]H[/TD]
[TD="align: right"]148.5[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD]531011 - EMPLOYEE FOUR - HOTEL[/TD]
[TD]S[/TD]
[TD="align: right"]67.5[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD]531012 - EMPLOYEE FOUR - DINNER YOU ONLY[/TD]
[TD]S[/TD]
[TD="align: right"]15.9[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD]531013 - EMPLOYEE FOUR - HOTEL[/TD]
[TD]S[/TD]
[TD="align: right"]67.5[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD]531014 - EMPLOYEE FOUR - DINNER YOU ONLY[/TD]
[TD]S[/TD]
[TD="align: right"]13.9[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD]115908 - EMPLOYEE FOUR - TOTAL[/TD]
[TD]H[/TD]
[TD="align: right"]164.8[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD]531016 - EMPLOYEE FOUR - HOTEL[/TD]
[TD]S[/TD]
[TD="align: right"]57.2[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD]531018 - EMPLOYEE FOUR - HOTEL[/TD]
[TD]S[/TD]
[TD="align: right"]57.21[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD]531019 - EMPLOYEE FOUR - DINNER YOU ONLY[/TD]
[TD]S[/TD]
[TD="align: right"]21.1[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD]115909 - EMPLOYEE FOUR - TOTAL[/TD]
[TD]H[/TD]
[TD="align: right"]135.51[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD]531021 - EMPLOYEE FOUR - HOTEL[/TD]
[TD]S[/TD]
[TD="align: right"]60[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD]531022 - EMPLOYEE FOUR - HOTEL BAR BILL[/TD]
[TD]S[/TD]
[TD="align: right"]2.2[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD]115910 - EMPLOYEE FOUR - TOTAL[/TD]
[TD]H[/TD]
[TD="align: right"]62.2[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD]530896 - EMPLOYEE FIVE - PARKING[/TD]
[TD]S[/TD]
[TD="align: right"]7.5[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD]115892 - EMPLOYEE FIVE - TOTAL[/TD]
[TD]H[/TD]
[TD="align: right"]7.5[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD]530897 - EMPLOYEE FIVE - PARKING[/TD]
[TD]S[/TD]
[TD="align: right"]13[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD]115893 - EMPLOYEE FIVE - TOTAL[/TD]
[TD]H[/TD]
[TD="align: right"]13[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD]530900 - EMPLOYEE FIVE - HOTEL[/TD]
[TD]S[/TD]
[TD="align: right"]50[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD]530901 - EMPLOYEE FIVE - MEALS - DINNER (ATTENDEES)[/TD]
[TD]S[/TD]
[TD="align: right"]17.25[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD]115894 - EMPLOYEE FIVE - TOTAL[/TD]
[TD]H[/TD]
[TD="align: right"]67.25[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD]530903 - EMPLOYEE FIVE - HOTEL[/TD]
[TD]S[/TD]
[TD="align: right"]91.2[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD]530904 - EMPLOYEE FIVE - PARKING[/TD]
[TD]S[/TD]
[TD="align: right"]7[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD]115896 - EMPLOYEE FIVE - TOTAL[/TD]
[TD]H[/TD]
[TD="align: right"]98.2[/TD]
[/TR]
</tbody>[/TABLE]
I am trying to write a macro that would only extract employees that have more than one claim in each week and put it in a seperate tab in my workbook in below fashion.
[TABLE="class: grid, width: 693"]
<tbody>[TR]
[TD]W/E[/TD]
[TD]Employee[/TD]
[TD]Lines of claim[/TD]
[TD]Amount of claim (exact)[/TD]
[/TR]
[TR]
[TD="align: right"]14/06/2019[/TD]
[TD]EMPLOYEE FOUR[/TD]
[TD="align: right"]3[/TD]
[TD] £ 148.50[/TD]
[/TR]
[TR]
[TD="align: right"]14/06/2019[/TD]
[TD]EMPLOYEE FOUR[/TD]
[TD="align: right"]4[/TD]
[TD] £ 164.80[/TD]
[/TR]
[TR]
[TD="align: right"]14/06/2019[/TD]
[TD]EMPLOYEE FOUR[/TD]
[TD="align: right"]3[/TD]
[TD] £ 135.51[/TD]
[/TR]
[TR]
[TD="align: right"]14/06/2019[/TD]
[TD]EMPLOYEE FOUR[/TD]
[TD="align: right"]2[/TD]
[TD] £ 62.20[/TD]
[/TR]
[TR]
[TD="align: right"]14/06/2019[/TD]
[TD]EMPLOYEE FIVE[/TD]
[TD="align: right"]1[/TD]
[TD] £ 7.50[/TD]
[/TR]
[TR]
[TD="align: right"]14/06/2019[/TD]
[TD]EMPLOYEE FIVE[/TD]
[TD="align: right"]1[/TD]
[TD] £ 13.00[/TD]
[/TR]
[TR]
[TD="align: right"]14/06/2019[/TD]
[TD]EMPLOYEE FIVE[/TD]
[TD="align: right"]2[/TD]
[TD] £ 67.25[/TD]
[/TR]
[TR]
[TD="align: right"]14/06/2019[/TD]
[TD]EMPLOYEE FIVE[/TD]
[TD="align: right"]2[/TD]
[TD] £ 98.20[/TD]
[/TR]
</tbody>[/TABLE]
Apologies for the long post, I am completly stuck!
thanks for any help you can give.
Sophie
I have used this forum to find answers for years and always found what I was looking for without even having to post my question. But this time I am stuck, proably because I don't knwo what exactly to search for.
Let me explain what I am trying to achieve first:
I am analysing employes expenses claims based on an extract I get out of our online expense portal. The aim here is to identify employees with multiple claims in a single week and summarise in a list who it is, how many lines (items) per claim and the total value of the claim. Below is an example extract from the source file. Column SHKZG defines what each row is, "S" is a line (item) and H is the total for a claim. and column WRBTR is the amount per line or claim. So employee one stayed in a hotel for 4 nights and paid £70 each night, and the total claim was £280.
[TABLE="class: grid, width: 738"]
<tbody>[TR]
[TD]HED[/TD]
[TD]SGTXT[/TD]
[TD]SHKZG[/TD]
[TD]WRBTR[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD]530683 - EMPLOYEE ONE - HOTEL[/TD]
[TD]S[/TD]
[TD="align: right"]70[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD]530684 - EMPLOYEE ONE - HOTEL[/TD]
[TD]S[/TD]
[TD="align: right"]70[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD]530685 - EMPLOYEE ONE - HOTEL[/TD]
[TD]S[/TD]
[TD="align: right"]70[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD]530686 - EMPLOYEE ONE - HOTEL[/TD]
[TD]S[/TD]
[TD="align: right"]70[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD]115860 - EMPLOYEE ONE - TOTAL[/TD]
[TD]H[/TD]
[TD="align: right"]280[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD]531727 - EMPLOYEE TWO - HOTEL[/TD]
[TD]S[/TD]
[TD="align: right"]80[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD]531728 - EMPLOYEE TWO - DINNER YOU ONLY[/TD]
[TD]S[/TD]
[TD="align: right"]14.47[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD]531729 - EMPLOYEE TWO - MEALS - LUNCH (ATTENDEES)[/TD]
[TD]S[/TD]
[TD="align: right"]11.53[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD]531730 - EMPLOYEE TWO - MEALS - LUNCH (ATTENDEES)[/TD]
[TD]S[/TD]
[TD="align: right"]12.48[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD]531731 - EMPLOYEE TWO - MEALS - LUNCH (ATTENDEES)[/TD]
[TD]S[/TD]
[TD="align: right"]7.98[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD]531732 - EMPLOYEE TWO - BREAKFAST YOU ONLY[/TD]
[TD]S[/TD]
[TD="align: right"]1.49[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD]116041 - EMPLOYEE TWO - TOTAL[/TD]
[TD]H[/TD]
[TD="align: right"]127.95[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD]530928 - EMPLOYEE THREE - BUSINESS MILEAGE - PRIVATE CAR[/TD]
[TD]S[/TD]
[TD="align: right"]153[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD]530930 - EMPLOYEE THREE - HOTEL[/TD]
[TD]S[/TD]
[TD="align: right"]60[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD]115902 - EMPLOYEE THREE - TOTAL[/TD]
[TD]H[/TD]
[TD="align: right"]213[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD]530981 - EMPLOYEE FOUR - HOTEL[/TD]
[TD]S[/TD]
[TD="align: right"]67.5[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD]530983 - EMPLOYEE FOUR - HOTEL[/TD]
[TD]S[/TD]
[TD="align: right"]66[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD]530984 - EMPLOYEE FOUR - DINNER YOU ONLY[/TD]
[TD]S[/TD]
[TD="align: right"]15[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD]115905 - EMPLOYEE FOUR - TOTAL[/TD]
[TD]H[/TD]
[TD="align: right"]148.5[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD]531011 - EMPLOYEE FOUR - HOTEL[/TD]
[TD]S[/TD]
[TD="align: right"]67.5[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD]531012 - EMPLOYEE FOUR - DINNER YOU ONLY[/TD]
[TD]S[/TD]
[TD="align: right"]15.9[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD]531013 - EMPLOYEE FOUR - HOTEL[/TD]
[TD]S[/TD]
[TD="align: right"]67.5[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD]531014 - EMPLOYEE FOUR - DINNER YOU ONLY[/TD]
[TD]S[/TD]
[TD="align: right"]13.9[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD]115908 - EMPLOYEE FOUR - TOTAL[/TD]
[TD]H[/TD]
[TD="align: right"]164.8[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD]531016 - EMPLOYEE FOUR - HOTEL[/TD]
[TD]S[/TD]
[TD="align: right"]57.2[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD]531018 - EMPLOYEE FOUR - HOTEL[/TD]
[TD]S[/TD]
[TD="align: right"]57.21[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD]531019 - EMPLOYEE FOUR - DINNER YOU ONLY[/TD]
[TD]S[/TD]
[TD="align: right"]21.1[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD]115909 - EMPLOYEE FOUR - TOTAL[/TD]
[TD]H[/TD]
[TD="align: right"]135.51[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD]531021 - EMPLOYEE FOUR - HOTEL[/TD]
[TD]S[/TD]
[TD="align: right"]60[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD]531022 - EMPLOYEE FOUR - HOTEL BAR BILL[/TD]
[TD]S[/TD]
[TD="align: right"]2.2[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD]115910 - EMPLOYEE FOUR - TOTAL[/TD]
[TD]H[/TD]
[TD="align: right"]62.2[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD]530896 - EMPLOYEE FIVE - PARKING[/TD]
[TD]S[/TD]
[TD="align: right"]7.5[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD]115892 - EMPLOYEE FIVE - TOTAL[/TD]
[TD]H[/TD]
[TD="align: right"]7.5[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD]530897 - EMPLOYEE FIVE - PARKING[/TD]
[TD]S[/TD]
[TD="align: right"]13[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD]115893 - EMPLOYEE FIVE - TOTAL[/TD]
[TD]H[/TD]
[TD="align: right"]13[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD]530900 - EMPLOYEE FIVE - HOTEL[/TD]
[TD]S[/TD]
[TD="align: right"]50[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD]530901 - EMPLOYEE FIVE - MEALS - DINNER (ATTENDEES)[/TD]
[TD]S[/TD]
[TD="align: right"]17.25[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD]115894 - EMPLOYEE FIVE - TOTAL[/TD]
[TD]H[/TD]
[TD="align: right"]67.25[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD]530903 - EMPLOYEE FIVE - HOTEL[/TD]
[TD]S[/TD]
[TD="align: right"]91.2[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD]530904 - EMPLOYEE FIVE - PARKING[/TD]
[TD]S[/TD]
[TD="align: right"]7[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD]115896 - EMPLOYEE FIVE - TOTAL[/TD]
[TD]H[/TD]
[TD="align: right"]98.2[/TD]
[/TR]
</tbody>[/TABLE]
I am trying to write a macro that would only extract employees that have more than one claim in each week and put it in a seperate tab in my workbook in below fashion.
[TABLE="class: grid, width: 693"]
<tbody>[TR]
[TD]W/E[/TD]
[TD]Employee[/TD]
[TD]Lines of claim[/TD]
[TD]Amount of claim (exact)[/TD]
[/TR]
[TR]
[TD="align: right"]14/06/2019[/TD]
[TD]EMPLOYEE FOUR[/TD]
[TD="align: right"]3[/TD]
[TD] £ 148.50[/TD]
[/TR]
[TR]
[TD="align: right"]14/06/2019[/TD]
[TD]EMPLOYEE FOUR[/TD]
[TD="align: right"]4[/TD]
[TD] £ 164.80[/TD]
[/TR]
[TR]
[TD="align: right"]14/06/2019[/TD]
[TD]EMPLOYEE FOUR[/TD]
[TD="align: right"]3[/TD]
[TD] £ 135.51[/TD]
[/TR]
[TR]
[TD="align: right"]14/06/2019[/TD]
[TD]EMPLOYEE FOUR[/TD]
[TD="align: right"]2[/TD]
[TD] £ 62.20[/TD]
[/TR]
[TR]
[TD="align: right"]14/06/2019[/TD]
[TD]EMPLOYEE FIVE[/TD]
[TD="align: right"]1[/TD]
[TD] £ 7.50[/TD]
[/TR]
[TR]
[TD="align: right"]14/06/2019[/TD]
[TD]EMPLOYEE FIVE[/TD]
[TD="align: right"]1[/TD]
[TD] £ 13.00[/TD]
[/TR]
[TR]
[TD="align: right"]14/06/2019[/TD]
[TD]EMPLOYEE FIVE[/TD]
[TD="align: right"]2[/TD]
[TD] £ 67.25[/TD]
[/TR]
[TR]
[TD="align: right"]14/06/2019[/TD]
[TD]EMPLOYEE FIVE[/TD]
[TD="align: right"]2[/TD]
[TD] £ 98.20[/TD]
[/TR]
</tbody>[/TABLE]
Apologies for the long post, I am completly stuck!
thanks for any help you can give.
Sophie