change cell colour based on

Trevor3007

Well-known Member
Joined
Jan 26, 2017
Messages
675
Office Version
  1. 365
Platform
  1. Windows
Hi,

I have attempted this myself but with my very, very limited VB knowledge, cannot get it to work.

Below is a screenshot from the april2022 worksheet, (starting from jan 2022 - feb2023) . its a rather tedious job to colour each cell pne by one with the applicbale background. Can some super VB person come up with solurion to change the cell based on the text within ( for exampe where 'R and Off' is placed in a cell that cell(s) will change the background to yellow) One of the issues I found is when W falls on weekend this must turn 'green' whereas when 'w' is on a mon - friday its white , unless its a 'bank hol' which muxt be red ( as should S be too) The rota starts at e5-ah91. Each month has its own tab ( March22, April22 etc). I also thinking about having a worksheet that had the applicable text in col a & col b would have the colur and the code would look to that . For exanple
Col A Col B
Off VByellow
S VBred
E Vblightblue
H VBpurple

1660328019762.png


i don my virtual hat to the person(s) who can solve this as ( to me) its not an easy solution?

many thanks in advance
 
1660369198387.png


also are you able sort so if there is already text in the applicable cell(s). it will autofill rather than having to overtype?

its a brill bit of work any which way.
 
Upvote 0

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop

Forum statistics

Threads
1,223,264
Messages
6,171,081
Members
452,377
Latest member
bradfordsam

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