VBA to change cell interior colour rather than using conditional formatting

Excellover123

New Member
Joined
Jul 13, 2018
Messages
37
Hello Massage board
I have got a sheet that shows what delivery quantities I'm expecting. If the cell shows 0 then nothing is required, however, I'm wanting to colour the cell interior a different colour based on what supplier the goods are coming from.
The cells i want to colour are in D5:X5 on a sheet called Egg#. I would like it to check the part code in A3 & the delivery date's are in D2:X2
The delivery data is on a sheet called Exp Receipts. The Lookup key (Part code concatenated with the date) is in column H & the supply code is in column B.
I was thinking something like if the cell is >0 then a Xlookup to get the supplier code & changed the colour based on that?
Any help would be great.
Thanks in advance
Gary
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
Do you potentially want a different colour for each supplier?

I wonder why each delivery is not on a different row.
 
Upvote 0
Do you potentially want a different colour for each supplier?

I wonder why each delivery is not on a different row.
Hi Herakles, yes I was hope to. There's 6 suppliers altogether. I'm open to what colours can be used.
Here how the sheet looks

1689765217695.png

Regards, Gary
 
Last edited:
Upvote 0
You will need to store the colours somewhere.

One way to do this is to set the Fill colour of the cell on the supplier sheet that has the supplier code in it.

Can you post some data using XL2BB?
 
Upvote 0

Forum statistics

Threads
1,223,275
Messages
6,171,126
Members
452,381
Latest member
Nova88

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