View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Lonnie M. Lonnie M. is offline
external usenet poster
 
Posts: 184
Default Having problem with subtotal helpme out

Hi, I am not sure if I understand your question, but here is my stab at
it:

Sub mySubtotal
Dim endrow&
endrow = ActiveSheet.Cells(Rows.Count, "A").End(xlUp).Row
Cells(endrow + 2, 2).Formula = "=SUBTOTAL(9,b2:b" & endrow & ")"
' SUBTOTAL(109, ... is a better option if you are using Excel 2003
Range("b" & endrow + 2 & ":C" & endrow + 2).FillRight
End Sub

HTH--Lonnie M.