Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
ActiveCell.Formula and IF statement
Hi,
Could I get a hand interpreting this code?? I gather that IF is an alias for IIf with the syntax: IIf(expr, truepart, falsepart) ActiveCell.FormulaR1C1 = "=IF(RC[-1]=0.04,IF(RC[-1]=0.05,""Substantial"",""Alert""),IF(RC[1]="" "",""No"",""Alert""))" I want to modify this so when the expression evaluates to "Substantial" the whole row is highlighted too. Any ideas? Cheers! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
ActiveCell.Formula and IF statement
David,
Essentially: If ActiveCell(1, 0).Value 0.05 Then ActiveCell.EntireRow.Interior.ColorIndex = 3 End If The "IF" is not an 'Alias' for IIf: your code snippet puts an IF formula (actually, a nested IF) into the activecell. And the formula doesn't look to be well constructed, but that wasn't your question.... HTH, Bernie MS Excel MVP "David" wrote in message om... Hi, Could I get a hand interpreting this code?? I gather that IF is an alias for IIf with the syntax: IIf(expr, truepart, falsepart) ActiveCell.FormulaR1C1 = "=IF(RC[-1]=0.04,IF(RC[-1]=0.05,""Substantial"",""Alert""),IF(RC[1]="" "",""No"",""Alert""))" I want to modify this so when the expression evaluates to "Substantial" the whole row is highlighted too. Any ideas? Cheers! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
If activecell.column = variable then activecell,offset (0,1) | Excel Discussion (Misc queries) | |||
ActiveCell.Formula Syntax | Excel Programming | |||
activecell.formula syntax | Excel Programming | |||
Whats wrong with this VBA statement -ActiveCell.FormulaR1C1...? | Excel Programming | |||
Formula with an ActiveCell | Excel Programming |