Results 1 to 7 of 7

Hiding grand total column in a pivot table using VBA/Macro

Threaded View

  1. #1
    Registered User
    Join Date
    08-20-2012
    Location
    California, USA
    MS-Off Ver
    Excel 2010
    Posts
    3

    Hiding grand total column in a pivot table using VBA/Macro

    Hi,

    I have the following code to create a pivot table. I want to hide the grand total for rows in the pivot. Can somebody please help m with the code?

    Sub Pivot()
    ActiveWorkbook.Sheets("HW - FY11Actuals").Select
        Range("A1").Select
        
        ' Create the PivotTable object based on the Employee data on Sheet1.
        Set objTable = Sheet1.PivotTableWizard
        
        ' Specify row and column fields.
        Set objField = objTable.PivotFields("Product Family")
        objField.Orientation = xlRowField
        Set objField = objTable.PivotFields("Fiscal Period ID")
        objField.Orientation = xlColumnField
        
        ' Specify a data field with its summary
        ' function and format.
        Set objField = objTable.PivotFields("Cisco Bookings Net")
        objField.Orientation = xlDataField
        objField.Function = xlSum
        objField.NumberFormat = "#,##.##"
        
              
    End Sub
    Thanks
    Last edited by Cutter; 08-24-2012 at 02:08 PM. Reason: Added code tags

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1