Jump to content

Recommended Posts

Posted

instead of using conditional formatting in excel to change the colour of a cell, is there a formula where the cell can = the colour red. thanks for your help.

chris


Posted

What you want can be done with VB for Applications (VBA).

Please be more specific of what is you are trying to accomplish, that could provide more info to help you better.

Posted

i would like a cell to say

IF(c1=c2,"CELL COLOUR IS RED","CELL COLOUR IS BLUE")

But how do i write this properly so the cell colours actually change. i cannot use conditional formatting, because on the shared workbook i am using it is not accessible. thanks

Posted

If what you mean to do is that if cell #1 equals cell #2, if they are equal one of them turns red (you did not specify which one), else (cell #1 <> cell #2) then one of them turns blue.

IF that is what you want, maybe this could help.

Let's say you have a number on A1 and if it equals that of A2 then A3 would become Red, else A3 would be Green

If ActiveSheet.Range("A1").Value = ActiveSheet.Range("A2").Value Then
   ActiveSheet.Range("A3").Interior.ColorIndex = 3
Else
   ActiveSheet.Range("A3").Interior.ColorIndex = 4
End If

Where ColorIndex is (search in MS Excel VB reference help file):

  • 3 = Red
  • 4 = Green
  • 5 = Blue.. .and so on

If THAT is NOT what you are trying to do, please be more SPECIFIC! ;)

Posted

thanks a lot! that has helped me immensly, and i have now completed the sheet and it all works accordingly, thanks again....

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...