Jump to content
EduGeek EdSec 2026 is Go! 27th Oct in Derby! Join us for a day of EdTech security focused talks, networking, and an evening social ×

Recommended Posts

Posted

Okay I know I can use conditional formatting on a cell depending on the value within that cell however I want to change its colour depending on the value of an adjacent cell and seeing as Excel is not my forte I wondered if anyone there would know?

 

Wes

Posted

There is probably an easier way but, if I can't see an obvious function, I tend to use a bit of VBA.

 

The following subroutine checks if A2 is greater than 1. If it is then it changes the colour of A1 to red

 

Sub change_colour

If cells(1,2).value>1 then

Range("A1").Select

Selection.Interior.ColorIndex=3

End If

End Sub

 

Attach it to a macro button or key press. If you have a lot of data a for/next loop can easily be added.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...