View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
mrdata[_25_] mrdata[_25_] is offline
external usenet poster
 
Posts: 1
Default Subtotal \ Grand Total in VBA


Tom:
The code works great but it does not give me the result's I need.

First I only want to have a grand total in range P2
Currently I get the grand total below the data and in range P2

Also Is there a way to format the subtotal and grand total results to
show thousands. without having to do it manualy.

Here is the code I am using.


Range("A4").Select
Selection.Subtotal GroupBy:=11, Function:=xlSum, TotalList:=Array(9),
_
Replace:=True ', PageBreaks:=False ', SummaryBelowdata:=True

Set rng = Range("I5", Cells(Rows.Count, "I").End(xlUp))
Range("P2").Formula = "=subtotal(9," & rng.Address & ")"

I have the Summarybelowdata part remed out but it still gives a Grand
total
Below data.


Thanks
Charles


--
mrdata
------------------------------------------------------------------------
mrdata's Profile: http://www.excelforum.com/member.php...o&userid=17899
View this thread: http://www.excelforum.com/showthread...hreadid=543677