redspanna
Well-known Member
- Joined
- Jul 27, 2005
- Messages
- 1,602
- Office Version
- 365
- Platform
- Windows
Hey all
Is there someone that can offer help with some VB code to do following task...
Here is some sample data from a banking statement
Can the code look down each item in column B and give it a catagory in column D
For example if B1 holds something like Mcdonalds or Pizza Hut or Burger King or any other possible match that I could add, then the category Take Away is added to D1
further example is in B3 and B10 this item is recognised as a Benefit so that is added to D3 and D10
I will add all the possible category in the code but just need some help to get started - maybe something like....
If B1 equals to Mcdonalds,Pizza Hut, Burger King, Donkey , Sim Dong (plus others) then the category field for D1 would be Take Away
ELSE
If B1 equals to Shell, BP, ESSO, Total, First Garage (plus others) then the category field for D1 would be Fuel
ELSE
If B1 equals to ABC Council, Council ABC Payments, State Tax (plus others) then the category field for D1 would be Benefit
If no match found then leave D1 blank and move onto next cell in column B
Is this possible?? - any help much appreciated
thanks in advance
Is there someone that can offer help with some VB code to do following task...
Here is some sample data from a banking statement
Book1 | ||||||
---|---|---|---|---|---|---|
A | B | C | D | |||
1 | 01-Mar-22 | McDonalds | 15.47 | Take-Away | ||
2 | 02-Mar-22 | Esso | 25 | Fuel | ||
3 | 02-Mar-22 | ABC Council | 150 | Benefit | ||
4 | 03-Mar-22 | Sainsburys | 135 | Grocery | ||
5 | 04-Mar-22 | High Street Cinema | 25 | Activity | ||
6 | 05-Mar-22 | Pockit | 10 | Gift | ||
7 | 05-Mar-22 | BP Fuel | 10 | Fuel | ||
8 | 06-Mar-22 | Iceland | 19 | Grocery | ||
9 | 07-Mar-22 | Work | 1500 | Salary | ||
10 | 08-Mar-22 | State Tax | 35 | Benefit | ||
Sheet1 |
Can the code look down each item in column B and give it a catagory in column D
For example if B1 holds something like Mcdonalds or Pizza Hut or Burger King or any other possible match that I could add, then the category Take Away is added to D1
further example is in B3 and B10 this item is recognised as a Benefit so that is added to D3 and D10
I will add all the possible category in the code but just need some help to get started - maybe something like....
If B1 equals to Mcdonalds,Pizza Hut, Burger King, Donkey , Sim Dong (plus others) then the category field for D1 would be Take Away
ELSE
If B1 equals to Shell, BP, ESSO, Total, First Garage (plus others) then the category field for D1 would be Fuel
ELSE
If B1 equals to ABC Council, Council ABC Payments, State Tax (plus others) then the category field for D1 would be Benefit
If no match found then leave D1 blank and move onto next cell in column B
Is this possible?? - any help much appreciated
thanks in advance