Pivot Table Formula Disaster

MikeyFB

Board Regular
Joined
Aug 15, 2007
Messages
66
Hello!

Please bare with my images, its a word document, im at work and therefore have no otehr option. The problem is when i enter my YTD formula the table duplicates all the sub categories into all the categories, which is unwanted.

Please help!

http://www.megaupload.com/?d=I2RH593Q
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
The only solution I know requires VBA - source Debra Dalgleish in:

http://www.pcreview.co.uk/forums/thread-1776326.php

Code:
Sub HidePivotZeroRows()
'   hide worksheet rows that contain all zeros
    Dim rng As Range
    For Each rng In ActiveSheet _
        .PivotTables(1).DataBodyRange.Rows
        If Application.Sum(rng) = 0 Then
            rng.EntireRow.Hidden = True
        Else
'           unhide any previously hidden rows
            rng.EntireRow.Hidden = False
        End If
    Next rng
End Sub

Sub UnhidePivotRows()
'   unhide all rows
    Dim rng As Range
    For Each rng In ActiveSheet _
        .PivotTables(1).DataBodyRange.Rows
        rng.EntireRow.Hidden = False
    Next rng
End Sub
 
Upvote 0
Press Alt+F11 to go to the Visual Basic Editor. Click your workbook in the Project window on the left and choose Insert|Module from the menu. Paste the code I posted in the window on the right. Press Alt+F11 to return to your workbook.

From the menu choose Tools|Macro|Macros, choose the one you want and click Run.
 
Upvote 0

Forum statistics

Threads
1,214,585
Messages
6,120,399
Members
448,957
Latest member
Hat4Life

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top