Macro loop to check parts ordered vs Stock

RICK150

New Member
Joined
Nov 9, 2005
Messages
44
Hi there. I'm back again pleading with you nice people to help if possible.

I've got 2 sheets in my spreadsheet. Sheet one give me part to build (column A) colour (column B) and time (column C) required.

Sheet 2 gives me How many parts of each colour (column A) and Quantity in stock (column B)

I'm trying to write a macro that will start at the top of sheet 1. It will look at the top entry in the colour column and check to see if we have any stock for that colour in sheet 2. I then want the macro loop to delete 1 from the stock level. and go down to the next line. If we have no stock of that colour left then i'd like it to say "Warning" instead of 0.

This mean i can look down the list on sheet A and see approximatly what time we'll run out of that colour.


Sheet 1:
A B C D
Part 1 Red 06:00
Part 2 Red 07:00
Part 3 Blue 08:00

Sheet 2:
A B
Red 1
Blue 10
Black 2


By the time the macro has run it should look like:

Sheet 1:
A B C D
Part 1 Red 06:00 OK
Part 2 Red 07:00 Warning
Part 3 Blue 08:00 OK

Sheet 2:
A B
Red 0
Blue 9
Black 2

If anyone could help me out it would be very much appreciated. If you need more information then please let me know.

Thanks in advance for any help.

Ricky.
 

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,224,603
Messages
6,179,854
Members
452,948
Latest member
UsmanAli786

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