Change Cell colour based on another cells result [Closed]

Report
-
JamesClucas
Posts
1
Registration date
Friday June 24, 2016
Status
Member
Last seen
June 24, 2016
-
Hello,
I am writing a programme in excel for tracking what jobs are running over the antipated delivery date, therefore I am looking for help on how to change the colour of different customers listed in the column A2:A100 based on a 1 being displayed column AB2:AB100) to trigger the change.
Regards
Andy



4 replies

Posts
12254
Registration date
Wednesday May 14, 2008
Status
Moderator
Last seen
December 10, 2019
1
Hello,

With a macro?

Sub Color_Cells()
Dim Cel As Range
For Each Cel In Range("AB2:AB100")
    'If you want another color, change the number 3 into a integer > 0 and < 50
    If Cel.Value = 1 Then Cel.Offset(0, -27).Interior.ColorIndex = 3
Next Cel
End Sub 


How to use it?
1. Copy the below code/function
2. Open your NEW workbook
3. Press the keys ALT + F11 to open the Visual Basic Editor
4. Press the keys ALT + I to activate the Insert menu
5. Press M to insert a Standard Module
6. Where the cursor is flashing, paste the code
7. Press the keys ALT + Q to exit the Editor, and return to Excel
8. To run the macro from Excel press ALT + F8 to display the Run Macro Dialog. Double Click the macro's name to Run it.

JamesClucas
Posts
1
Registration date
Friday June 24, 2016
Status
Member
Last seen
June 24, 2016

Is there anyway to do this on Google sheets please? I need it ASAP thanks!