marcvanderpeet12
Member
Dear all,
I have the following problem: I want to create an excel function/vba script which can do the following:
According to two number in two cell it should produce a colour. So fe: if e1 = 2 and g1 = 3 in want "yellow" in cell j1. I tried to do this with a nested if fuction but this is going to be quite a hassle asthe values for both e1 and g1 can have 3 different values (which can lead to 9 different colours).
I tried to build a build a case VBA script but I cant seem to find AND option in the statements. Something like this does not work for example:
Case "E1" = 2 AND "F2" = 1
Range("S2") = "GREEN"
End Select
Anybody some suggestion on how i can achieve this? Help would be highly appreciated!
Dear regards,
Marc
I have the following problem: I want to create an excel function/vba script which can do the following:
According to two number in two cell it should produce a colour. So fe: if e1 = 2 and g1 = 3 in want "yellow" in cell j1. I tried to do this with a nested if fuction but this is going to be quite a hassle asthe values for both e1 and g1 can have 3 different values (which can lead to 9 different colours).
I tried to build a build a case VBA script but I cant seem to find AND option in the statements. Something like this does not work for example:
Case "E1" = 2 AND "F2" = 1
Range("S2") = "GREEN"
End Select
Anybody some suggestion on how i can achieve this? Help would be highly appreciated!
Dear regards,
Marc