Hi all, i would like to write a vba so that where in col. "D" the number start from number 92 and in col. "F" is the category "BEVERGAE" should place on number's right side "APERITIF" and if in col. "F" and it start from 92 should place "SPICES" and so on.
In sch.1. are the original data and in sch.2. is the expected result.
Many thanks in advance
SCH.1.
<colgroup><col style="mso-width-source:userset;mso-width-alt:1462;width:30pt" width="40"> <col style="width:48pt" width="64"> <col style="mso-width-source:userset;mso-width-alt:1682;width:35pt" width="46"> <col style="mso-width-source:userset;mso-width-alt:2048;width:42pt" width="56"> <col style="mso-width-source:userset;mso-width-alt:3913;width:80pt" width="107"> <col style="mso-width-source:userset;mso-width-alt:3328;width:68pt" width="91"> <col style="mso-width-source:userset;mso-width-alt:4534;width:93pt" width="124"> </colgroup><tbody>
[TD="width: 40"][/TD]
[TD="width: 64"]A[/TD]
[TD="width: 46"]B[/TD]
[TD="width: 56"]C[/TD]
[TD="width: 107"]D[/TD]
[TD="width: 91"]E[/TD]
[TD="width: 124"]F[/TD]
[TD="class: xl65"]03-02-17[/TD]
[TD="class: xl66"]ISSUE[/TD]
[TD="class: xl66"] [/TD]
[TD="class: xl66"]92145[/TD]
[TD="class: xl66"] [/TD]
[TD="class: xl66"]BEVERAGE[/TD]
[TD="class: xl65"]10-05-17[/TD]
[TD="class: xl66"]ISSUE[/TD]
[TD="class: xl66"] [/TD]
[TD="class: xl66"]92505[/TD]
[TD="class: xl66"] [/TD]
[TD="class: xl66"]BEVERAGE[/TD]
[TD="class: xl65"]10-05-17[/TD]
[TD="class: xl66"]ISSUE[/TD]
[TD="class: xl66"] [/TD]
[TD="class: xl66"]92800[/TD]
[TD="class: xl66"] [/TD]
[TD="class: xl66"]BEVERAGE[/TD]
[TD="class: xl65"]10-05-17[/TD]
[TD="class: xl66"]ISSUE[/TD]
[TD="class: xl66"] [/TD]
[TD="class: xl66"]92905[/TD]
[TD="class: xl66"] [/TD]
[TD="class: xl66"]FOOD[/TD]
[TD="class: xl65"]10-05-17[/TD]
[TD="class: xl66"]ISSUE[/TD]
[TD="class: xl66"] [/TD]
[TD="class: xl66"]92608[/TD]
[TD="class: xl66"] [/TD]
[TD="class: xl66"]HOT BEVERAGE[/TD]
[TD="class: xl65"]10-05-17[/TD]
[TD="class: xl66"]ISSUE[/TD]
[TD="class: xl66"] [/TD]
[TD="class: xl66"]92700[/TD]
[TD="class: xl66"] [/TD]
[TD="class: xl66"]HOT BEVERAGE
[/TD]
</tbody>
SCH.2.
<colgroup><col style="mso-width-source:userset;mso-width-alt:1462;width:30pt" width="40"> <col style="width:48pt" width="64"> <col style="mso-width-source:userset;mso-width-alt:1682;width:35pt" width="46"> <col style="mso-width-source:userset;mso-width-alt:2048;width:42pt" width="56"> <col style="mso-width-source:userset;mso-width-alt:3913;width:80pt" width="107"> <col style="mso-width-source:userset;mso-width-alt:3328;width:68pt" width="91"> <col style="mso-width-source:userset;mso-width-alt:4534;width:93pt" width="124"> </colgroup><tbody>
[TD="width: 40"][/TD]
[TD="width: 64"]A[/TD]
[TD="width: 46"]B[/TD]
[TD="width: 56"]C[/TD]
[TD="width: 107"]D[/TD]
[TD="width: 91"]E[/TD]
[TD="width: 124"]F[/TD]
[TD="class: xl65"]03-02-17[/TD]
[TD="class: xl66"]ISSUE[/TD]
[TD="class: xl66"] [/TD]
[TD="class: xl66"]92145 APERITIF[/TD]
[TD="class: xl66"] [/TD]
[TD="class: xl66"]BEVERAGE[/TD]
[TD="class: xl65"]10-05-17[/TD]
[TD="class: xl66"]ISSUE[/TD]
[TD="class: xl66"] [/TD]
[TD="class: xl66"]92505 APERITIF[/TD]
[TD="class: xl66"] [/TD]
[TD="class: xl66"]BEVERAGE[/TD]
[TD="class: xl65"]10-05-17[/TD]
[TD="class: xl66"]ISSUE[/TD]
[TD="class: xl66"] [/TD]
[TD="class: xl66"]92800 APERITIF[/TD]
[TD="class: xl66"] [/TD]
[TD="class: xl66"]BEVERAGE[/TD]
[TD="class: xl65"]10-05-17[/TD]
[TD="class: xl66"]ISSUE[/TD]
[TD="class: xl66"] [/TD]
[TD="class: xl66"]92905 SPICES[/TD]
[TD="class: xl66"] [/TD]
[TD="class: xl66"]FOOD[/TD]
[TD="class: xl65"]10-05-17[/TD]
[TD="class: xl66"]ISSUE[/TD]
[TD="class: xl66"] [/TD]
[TD="class: xl66"]92608 COFFEE[/TD]
[TD="class: xl66"] [/TD]
[TD="class: xl66"]HOT BEVERAGE[/TD]
[TD="class: xl65"]10-05-17[/TD]
[TD="class: xl66"]ISSUE
[/TD]
[TD="class: xl66"] [/TD]
[TD="class: xl66"]92700 COFFEE[/TD]
[TD="class: xl66"] [/TD]
[TD="class: xl66"]HOT BEVERAGE[/TD]
</tbody>
In sch.1. are the original data and in sch.2. is the expected result.
Many thanks in advance
SCH.1.
1 | DATE | TYPE | REF.1 | REF.2 | TR. NO | CATEGORY |
2 | ||||||
3 | ||||||
4 | ||||||
5 | ||||||
6 | ||||||
7 |
<colgroup><col style="mso-width-source:userset;mso-width-alt:1462;width:30pt" width="40"> <col style="width:48pt" width="64"> <col style="mso-width-source:userset;mso-width-alt:1682;width:35pt" width="46"> <col style="mso-width-source:userset;mso-width-alt:2048;width:42pt" width="56"> <col style="mso-width-source:userset;mso-width-alt:3913;width:80pt" width="107"> <col style="mso-width-source:userset;mso-width-alt:3328;width:68pt" width="91"> <col style="mso-width-source:userset;mso-width-alt:4534;width:93pt" width="124"> </colgroup><tbody>
[TD="width: 40"][/TD]
[TD="width: 64"]A[/TD]
[TD="width: 46"]B[/TD]
[TD="width: 56"]C[/TD]
[TD="width: 107"]D[/TD]
[TD="width: 91"]E[/TD]
[TD="width: 124"]F[/TD]
[TD="class: xl65"]03-02-17[/TD]
[TD="class: xl66"]ISSUE[/TD]
[TD="class: xl66"] [/TD]
[TD="class: xl66"]92145[/TD]
[TD="class: xl66"] [/TD]
[TD="class: xl66"]BEVERAGE[/TD]
[TD="class: xl65"]10-05-17[/TD]
[TD="class: xl66"]ISSUE[/TD]
[TD="class: xl66"] [/TD]
[TD="class: xl66"]92505[/TD]
[TD="class: xl66"] [/TD]
[TD="class: xl66"]BEVERAGE[/TD]
[TD="class: xl65"]10-05-17[/TD]
[TD="class: xl66"]ISSUE[/TD]
[TD="class: xl66"] [/TD]
[TD="class: xl66"]92800[/TD]
[TD="class: xl66"] [/TD]
[TD="class: xl66"]BEVERAGE[/TD]
[TD="class: xl65"]10-05-17[/TD]
[TD="class: xl66"]ISSUE[/TD]
[TD="class: xl66"] [/TD]
[TD="class: xl66"]92905[/TD]
[TD="class: xl66"] [/TD]
[TD="class: xl66"]FOOD[/TD]
[TD="class: xl65"]10-05-17[/TD]
[TD="class: xl66"]ISSUE[/TD]
[TD="class: xl66"] [/TD]
[TD="class: xl66"]92608[/TD]
[TD="class: xl66"] [/TD]
[TD="class: xl66"]HOT BEVERAGE[/TD]
[TD="class: xl65"]10-05-17[/TD]
[TD="class: xl66"]ISSUE[/TD]
[TD="class: xl66"] [/TD]
[TD="class: xl66"]92700[/TD]
[TD="class: xl66"] [/TD]
[TD="class: xl66"]HOT BEVERAGE
[/TD]
</tbody>
SCH.2.
1 | DATE | TYPE | REF.1 | REF.2 | TR. NO | CATEGORY |
2 | ||||||
3 | ||||||
4 | ||||||
5 | ||||||
6 | ||||||
7 |
<colgroup><col style="mso-width-source:userset;mso-width-alt:1462;width:30pt" width="40"> <col style="width:48pt" width="64"> <col style="mso-width-source:userset;mso-width-alt:1682;width:35pt" width="46"> <col style="mso-width-source:userset;mso-width-alt:2048;width:42pt" width="56"> <col style="mso-width-source:userset;mso-width-alt:3913;width:80pt" width="107"> <col style="mso-width-source:userset;mso-width-alt:3328;width:68pt" width="91"> <col style="mso-width-source:userset;mso-width-alt:4534;width:93pt" width="124"> </colgroup><tbody>
[TD="width: 40"][/TD]
[TD="width: 64"]A[/TD]
[TD="width: 46"]B[/TD]
[TD="width: 56"]C[/TD]
[TD="width: 107"]D[/TD]
[TD="width: 91"]E[/TD]
[TD="width: 124"]F[/TD]
[TD="class: xl65"]03-02-17[/TD]
[TD="class: xl66"]ISSUE[/TD]
[TD="class: xl66"] [/TD]
[TD="class: xl66"]92145 APERITIF[/TD]
[TD="class: xl66"] [/TD]
[TD="class: xl66"]BEVERAGE[/TD]
[TD="class: xl65"]10-05-17[/TD]
[TD="class: xl66"]ISSUE[/TD]
[TD="class: xl66"] [/TD]
[TD="class: xl66"]92505 APERITIF[/TD]
[TD="class: xl66"] [/TD]
[TD="class: xl66"]BEVERAGE[/TD]
[TD="class: xl65"]10-05-17[/TD]
[TD="class: xl66"]ISSUE[/TD]
[TD="class: xl66"] [/TD]
[TD="class: xl66"]92800 APERITIF[/TD]
[TD="class: xl66"] [/TD]
[TD="class: xl66"]BEVERAGE[/TD]
[TD="class: xl65"]10-05-17[/TD]
[TD="class: xl66"]ISSUE[/TD]
[TD="class: xl66"] [/TD]
[TD="class: xl66"]92905 SPICES[/TD]
[TD="class: xl66"] [/TD]
[TD="class: xl66"]FOOD[/TD]
[TD="class: xl65"]10-05-17[/TD]
[TD="class: xl66"]ISSUE[/TD]
[TD="class: xl66"] [/TD]
[TD="class: xl66"]92608 COFFEE[/TD]
[TD="class: xl66"] [/TD]
[TD="class: xl66"]HOT BEVERAGE[/TD]
[TD="class: xl65"]10-05-17[/TD]
[TD="class: xl66"]ISSUE
[/TD]
[TD="class: xl66"] [/TD]
[TD="class: xl66"]92700 COFFEE[/TD]
[TD="class: xl66"] [/TD]
[TD="class: xl66"]HOT BEVERAGE[/TD]
</tbody>