I am trying to use sumif statement with variable cell locations. In this snippet, sumif works as it should when R1C1 or absolute cell locations are used, but I can not get it to work using variable for cell location as in last line. Assist?
'
Dim Nmbr As Long
Nmbr = 32
ActiveCell.FormulaR1C1 = _
"=SUMIF(R[6]C[-7]:R[28]C[-7],""RNT Rent"",R[6]C[-6]:R[28]C[-6])"
Selection.ClearContents
ActiveCell.Formula = "=sumif(E10:e32,""RNT Rent"",F10:f32)"
Selection.ClearContents
ActiveCell.Formula = "=sumif(""E10:e""&Nmbr,""RNT Rent"",F10:f32)"
End Sub
'
Dim Nmbr As Long
Nmbr = 32
ActiveCell.FormulaR1C1 = _
"=SUMIF(R[6]C[-7]:R[28]C[-7],""RNT Rent"",R[6]C[-6]:R[28]C[-6])"
Selection.ClearContents
ActiveCell.Formula = "=sumif(E10:e32,""RNT Rent"",F10:f32)"
Selection.ClearContents
ActiveCell.Formula = "=sumif(""E10:e""&Nmbr,""RNT Rent"",F10:f32)"
End Sub