# Excel's function "Subtotal" trouble

**URL:** <https://www.dynamicsuser.net/t/excels-function-subtotal-trouble/8923>\
**Category:** Developers Forum\
**Created:** [July 12, 2004, 4:26pm UTC](https://www.dynamicsuser.net/t/excels-function-subtotal-trouble/8923 "2004-07-12T16:26:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yarovyy](https://avatars.discourse-cdn.com/v4/letter/y/958977/32.png) [@Yarovyy](https://www.dynamicsuser.net/u/Yarovyy)\
**Post date:** [July 12, 2004, 4:26pm UTC](https://www.dynamicsuser.net/t/excels-function-subtotal-trouble/8923/1 "2004-07-12T16:26:35Z")

</div>

Hi, I want to use Excel function “Subtotal” from Navision, but problem is here: When i write sheet.range(‘A9:U18’).subtotal(4,-4157,‘6’); all work properly. column F have a subtotals. But I need subtotals in columns F & G. sheet.range(‘A9:U18’).subtotal(4,-4157,‘6,7’); doesn’t work [:(!] Is anybody can help?

---

<div class="post-metadata">

**Author:** ![Yarovyy](https://avatars.discourse-cdn.com/v4/letter/y/958977/32.png) [@Yarovyy](https://www.dynamicsuser.net/u/Yarovyy)\
**Post date:** [July 12, 2004, 6:32pm UTC](https://www.dynamicsuser.net/t/excels-function-subtotal-trouble/8923/2 "2004-07-12T18:32:49Z")

</div>

as i understand Excel want ARRAY in parameters sheet.range(‘A9:U18’).subtotal(4,-4157,_ **ARRAY** _); _Excel macro:_ Selection.Subtotal GroupBy:=1, Function:=xlSum, TotalList:=**Array(5, 6)**, Replace:=True, PageBreaks:=False, SummaryBelowData:=True But how do this from Navision… arr[1]:=5; _try arr as Variant,as Integer, as Code_ arr[2]:=6; sheet.range(‘A9:U18’).subtotal(4,-4157,arr); - _nothing…_.
