Hi,
I am trying to write an IF THEN statement that checks to see if a cell is less than certain cells on a different sheet. I got the macro to work with hard inputs, but I can't seem to figure out how to input the ranges I would like to input. Below is my formula:
ActiveCell.FormulaR1C1 = "=IF(RC[-1] < ?, 1, IF(RC[-1] < ?, 2, IF(RC[-1] < ?, 3, IF(RC[-1] < ?, 4, IF(RC[-1] < ?, 5,0)))))"
For each ? I want to put in a reference to a cell in a named range. The references are as follows:
Range("PREINPUTS_CHILLERINFO").Cells(1,3)
Range("PREINPUTS_CHILLERINFO").Cells(2,3)
Range("PREINPUTS_CHILLERINFO").Cells(3,3)
Range("PREINPUTS_CHILLERINFO").Cells(4,3)
Range("PREINPUTS_CHILLERINFO").Cells(5,3)
Each time I try to put in the reference it won't run. In the end I want to copy and paste this cell down into a whole range. Would it be easier to use the range formulas instead?
Thanks for the help.
I am trying to write an IF THEN statement that checks to see if a cell is less than certain cells on a different sheet. I got the macro to work with hard inputs, but I can't seem to figure out how to input the ranges I would like to input. Below is my formula:
ActiveCell.FormulaR1C1 = "=IF(RC[-1] < ?, 1, IF(RC[-1] < ?, 2, IF(RC[-1] < ?, 3, IF(RC[-1] < ?, 4, IF(RC[-1] < ?, 5,0)))))"
For each ? I want to put in a reference to a cell in a named range. The references are as follows:
Range("PREINPUTS_CHILLERINFO").Cells(1,3)
Range("PREINPUTS_CHILLERINFO").Cells(2,3)
Range("PREINPUTS_CHILLERINFO").Cells(3,3)
Range("PREINPUTS_CHILLERINFO").Cells(4,3)
Range("PREINPUTS_CHILLERINFO").Cells(5,3)
Each time I try to put in the reference it won't run. In the end I want to copy and paste this cell down into a whole range. Would it be easier to use the range formulas instead?
Thanks for the help.