Dear All
I have a wierd query here.
I am preparing a Pivot using a macro, and then I am require to make a table of that Pivot in a non-pivot format. please dont ask me why, company requirement lol. In that table, the last row is grand total for obvious reasons. Now this table width is fix, as the heading are fixed, but the table hight is not fixed, as it will have rows depending upon the size of the pivot table which get generated using my existing macro.
I am attaching the image of my table with this thread.
Using my knowledge and using this forum, I used the following code which is doing a sum total at the end of each numericals. But here is the problem, in case the cell above the grand total row is if blank, then it will give the total in that blank cell. but I want the total to comes only in the row which has grand total written.
Please help me out.
Sub Slide07_Global_AutoSum()
For Each NumRange In Columns("I:N").SpecialCells(xlConstants, xlNumbers).Areas
SumAddr = NumRange.Address(False, False)
NumRange.Offset(NumRange.Count, 0).Resize(1, 1).Formula = "=SUM(" & SumAddr & ")"
c = NumRange.Count
Next NumRange
NoData:
Call Slide06_SEMEA
End Sub
I have a wierd query here.
I am preparing a Pivot using a macro, and then I am require to make a table of that Pivot in a non-pivot format. please dont ask me why, company requirement lol. In that table, the last row is grand total for obvious reasons. Now this table width is fix, as the heading are fixed, but the table hight is not fixed, as it will have rows depending upon the size of the pivot table which get generated using my existing macro.
I am attaching the image of my table with this thread.
Using my knowledge and using this forum, I used the following code which is doing a sum total at the end of each numericals. But here is the problem, in case the cell above the grand total row is if blank, then it will give the total in that blank cell. but I want the total to comes only in the row which has grand total written.
Please help me out.
Sub Slide07_Global_AutoSum()
For Each NumRange In Columns("I:N").SpecialCells(xlConstants, xlNumbers).Areas
SumAddr = NumRange.Address(False, False)
NumRange.Offset(NumRange.Count, 0).Resize(1, 1).Formula = "=SUM(" & SumAddr & ")"
c = NumRange.Count
Next NumRange
NoData:
Call Slide06_SEMEA
End Sub