![]() If for example at first the GrandTotal display in row 200, and after data source change and refresh the GrandTotal display in row 1000, it will always give you the correct GrandTotal. It returns values in the column but for some reason the grand total shows 0. #Grandtotal word codeSo you don't have to code to find the word for the pivot table GrandTotal first then offset(0,1) to get the value. grand total noun Save Word Synonyms & Antonyms of grand total a complete amount of something The grand total of the proceeds from the fund-raiser was over 100,000. This code is not depend on the row where the pivot table GrandTotal displayed. The word "SUM" is depend on what is your pivot table GrandTotal column header name. It also can be done with the code above : Sheets("Sheet1").Cells(LastRow, 18).value = pt1.GetPivotData("SUM").Value If it's correct, I wonder what is the problem ? If the value is the last row number in the sheet (where mine is 1048576), then maybe you need to put. But still I don't know what is the value of your 'LastRow' variable. If it's not correct, then maybe you need to add. The sum of the sums of several groups of numbers. If you step-run the code above, is the result of the active cell correct ? Which as you expected that the result of the active cell is the next empty cell. Also, I would like to be able to add a space before the subtotals and the Grand Total and be able to show the text in Bold or in a different format than the. The result of adding a set of figures or counting a number of items. I've found a code that can copy the grand total to a cell but IĬan't make it work to copy it in the next empty cell Sheets("Sheet1").Cells(LastRow, 18).Select In other words, with SUM, the value of the grand total row will always be. So your problem is the placement of the copied GrandTotal :). ![]() ![]() The grand total needs to be copied over to the next empty row in Range("B26").Value = pt2.GetPivotData("SUM").Value Range("E26").Value = pt1.GetPivotData("SUM").Value This is a code which maybe you can figure out to implement it to your code : Sub test() ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |