PDA

View Full Version : Solved: Using Variable Cell in IF Statement Formula



ranuse
12-21-2010, 09:47 AM
Hi,
I'm having problems with getting the syntax of displaying A[Row] as A63 to A67 in the formula. I want logical test of the IF statement to check A63 through A67. Row is stored in a variable that increases every iteration.
Any help is appreciated. Thanks.


Row = 63
Do Until Row > 67
For Col = 4 To 7
Cells(Row, Col).Select
ActiveCell.FormulaR1C1 = "=IF( A[Row] = ""Item1"", "1", "0" )

Next Col
Row = Row + 1
Loop

Bob Phillips
12-21-2010, 09:51 AM
For Col = 4 To 7
Cells(Row, Col).Formula = "=IF(A" & (Col + 59) & "=""Item1"",1,0)"
Next Col

ranuse
12-21-2010, 11:06 AM
Thanks alot, problem solved.