Change Cell colour based on another cells result

Closed
Andy - 28 Jan 2015 à 15:41
JamesClucas Posts 1 Registration date Friday 24 June 2016 Status Member Last seen 24 June 2016 - 24 Jun 2016 à 20:37
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 13513 Registration date Wednesday 14 May 2008 Status Moderator Last seen 4 January 2024 1
30 Jan 2015 à 01:40
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 24 June 2016 Status Member Last seen 24 June 2016
24 Jun 2016 à 20:37
Is there anyway to do this on Google sheets please? I need it ASAP thanks!