Change Cell colour based on another cells result

Closed
Andy - Jan 28, 2015 at 03:41 PM
JamesClucas Posts 1 Registration date Friday June 24, 2016 Status Member Last seen June 24, 2016 - Jun 24, 2016 at 08:37 PM
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



1 response

pijaku Posts 12263 Registration date Wednesday May 14, 2008 Status Moderator Last seen January 4, 2024 1
Jan 30, 2015 at 01:40 AM
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.

0
JamesClucas Posts 1 Registration date Friday June 24, 2016 Status Member Last seen June 24, 2016
Jun 24, 2016 at 08:37 PM
Is there anyway to do this on Google sheets please? I need it ASAP thanks!
0