Hi,
I have a list that contains many names of products (about 20k). I need to input the status (three options: bought, sold, expired).
[TABLE="width: 128"]
<colgroup><col span="2"></colgroup><tbody>[TR]
[TD="align: left"]A
Name[/TD]
[TD="align: left"]B
Status[/TD]
[/TR]
[TR]
[TD="align: left"]Apple[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: left"]Orange[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="colspan: 2, align: left"]Pineapple[/TD]
[/TR]
</tbody>[/TABLE]
I also have a list of bought, sold and expired items that are on separate sheets (respectively named Bought, Sold, Expired), I have also created named ranges out of each if this helps. The catch is that an item, let's say 'apple' can be in bought, sold and expired.
I would like to have a macro that would loop through each item on the list and check if they are in the named range with the following priorities:
If they are in bought, but not in sold or expired, status should return: Bought
If they are in sold, but not in expired, status should be: Sold
If they are in expired, status should be: Expired
If they are in none, leave status empty
It would then loop through each until the end of the list.
I would appreciate any help on this, I am relatively new at this.
Thanks
CG
I have a list that contains many names of products (about 20k). I need to input the status (three options: bought, sold, expired).
[TABLE="width: 128"]
<colgroup><col span="2"></colgroup><tbody>[TR]
[TD="align: left"]A
Name[/TD]
[TD="align: left"]B
Status[/TD]
[/TR]
[TR]
[TD="align: left"]Apple[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: left"]Orange[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="colspan: 2, align: left"]Pineapple[/TD]
[/TR]
</tbody>[/TABLE]
I also have a list of bought, sold and expired items that are on separate sheets (respectively named Bought, Sold, Expired), I have also created named ranges out of each if this helps. The catch is that an item, let's say 'apple' can be in bought, sold and expired.
I would like to have a macro that would loop through each item on the list and check if they are in the named range with the following priorities:
If they are in bought, but not in sold or expired, status should return: Bought
If they are in sold, but not in expired, status should be: Sold
If they are in expired, status should be: Expired
If they are in none, leave status empty
It would then loop through each until the end of the list.
I would appreciate any help on this, I am relatively new at this.
Thanks
CG