Conditional Macro

Adrae

Active Member
Joined
Feb 19, 2002
Messages
306
I need a macro or formula that will do the following:

1. If the value in Sheet1 cell A1 is found in cells in column A of Sheet2 where the value in column D is product in one cell and service in another then Sheet1 cell f1 = "Both".

2. If the value in Sheet1 cell A1 is found in column A of sheet two and the corresponing values in column D are only product then f1 = "Product.

The trick is that the value that is being search will appear more than once on Sheet 2. If different values are found in column D for the same value in column A then, the condition in #1 should apply.


I hope this all makes sense.
Can anyone get me started?
 
Thanks Al, you are awesome!! I made a couple of minor changes and it works like a gem, at least on the 5 records I tested it on. Wish me luck with the 40,000 records I intend to run it on. Thanks again.

:) Adrae
 
Upvote 0

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)

Forum statistics

Threads
1,213,520
Messages
6,114,101
Members
448,548
Latest member
harryls

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top