object doesn't support this property or method...??? SUBTOTAL error

jbaich

Board Regular
Joined
Nov 2, 2011
Messages
139
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
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
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
Well,

First of all in is FORMULA not FORUMLA :)
Try to change it and chęci again.
 
Upvote 0

Forum statistics

Threads
1,214,649
Messages
6,120,730
Members
448,987
Latest member
marion_davis

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top