F
fnwcanada
I am trying to enter a formula into a range of cells and in the
formula the row range also has to change. My error seems to be with
"range1" and it is not returning a cell but says "range1". Any
ideas???
Dim rw As Integer, range1 As Range, range2 As Range
For rw = 2 To 8
Set range1 = ActiveSheet.Cells(rw, 4)
Set range2 = ActiveSheet.Cells(rw, 6)
range2.formula = "=SUMPRODUCT(('271500.xls'!
category_271500= " & range1 & ")*('271500.xls'!amount_271500))"
Next rw
formula the row range also has to change. My error seems to be with
"range1" and it is not returning a cell but says "range1". Any
ideas???
Dim rw As Integer, range1 As Range, range2 As Range
For rw = 2 To 8
Set range1 = ActiveSheet.Cells(rw, 4)
Set range2 = ActiveSheet.Cells(rw, 6)
range2.formula = "=SUMPRODUCT(('271500.xls'!
category_271500= " & range1 & ")*('271500.xls'!amount_271500))"
Next rw