Hey guys, I'm sure this is something simple I'm missing, but I've tried reconfiguring this line as many ways as I can think of and can't get it right...
keep getting the Run-time error '438' Object doesn't support this property or method
All I'm trying to do is use subtotal, don't care whether the formula goes in the cell or just the value... the last iteration of the line was
in this instance the variable RowCount = 2 so I'm trying to Subtotal D16:D18 in cell D19
Right now this line (and the 2 other versions like it) is towards the end of this section of code...
Any help would be very much appreciated!
Thanks,
joe
keep getting the Run-time error '438' Object doesn't support this property or method
All I'm trying to do is use subtotal, don't care whether the formula goes in the cell or just the value... the last iteration of the line was
Code:
ActiveSheet.Range("D" & 16 + RowCount + 1).Forumla = "=SUBTOTAL(9,D16:D" & 16 + RowCount & ")"
in this instance the variable RowCount = 2 so I'm trying to Subtotal D16:D18 in cell D19
Right now this line (and the 2 other versions like it) is towards the end of this section of code...
Code:
With Template.Sheets("Summary Page")
OriginalRow = Application.Match(Roll, Master.Sheets("Original Values").Range("A:A"), 0)
RowCount = Application.WorksheetFunction.CountIf(Master.Sheets("Original Values").Range("A:A"), Roll) - 1
'Inserts some rows
Rows("16:" & 16 + RowCount - 1).EntireRow.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromRightOrBelow
'Populates some values
For i = 0 To RowCount
.Range("B" & 16 + i) = Master.Sheets("Original Values").Range("O" & OriginalRow + i).Value
.Range("C" & 16 + i) = Master.Sheets("Original Values").Range("Q" & OriginalRow + i).Value
.Range("D" & 16 + i) = Master.Sheets("Original Values").Range("S" & OriginalRow + i).Value
.Range("E" & 16 + i) = Master.Sheets("Original Values").Range("T" & OriginalRow + i).Value
.Range("F" & 16 + i) = Master.Sheets("Original Values").Range("U" & OriginalRow + i).Value
Next
'!!!! Why won't this work!!!???
.Range("D" & 16 + RowCount + 1).Forumla = "=SUBTOTAL(9,D16:D" & 16 + RowCount & ")"
.Range("E" & 16 + RowCount + 1).Forumla = "=SUBTOTAL(9,E16:E" & 16 + RowCount & ")"
.Range("F" & 16 + RowCount + 1).Forumla = "=SUBTOTAL(9,F16:F" & 16 + RowCount & ")"
End With
Any help would be very much appreciated!
Thanks,
joe