This topic is locked

Comparing cell values

7/20/2007 11:12:37 AM
ASPRunnerPro General questions
R
Rhoffman author

I have a need to change the cell color based on ANOTHER cell's value. Has anyone tried to do this?

V
Vladimir 7/23/2007

Hi,
You can do it using Custom option on the "View as" settings dialog on the Visual Editor tab. here is a sample code:

str = "<table width=100% bgcolor="

if Data("AnotherCellName")=AnotherCellValue then

str = str & "red"

else

str = str & "blue"

end if

str = str & "><tr><td>" & strValue & "</td></tr></table>"

strValue = str

R
Rhoffman author 7/23/2007

Vladamir-
That worked perfectly. Is the a CASE function to use instead of multiple if statements?
Rudy