Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7880657
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T04:11:43+00:00 2026-06-03T04:11:43+00:00

I am creating pivot tables in VB.NET and have run into a problem I

  • 0

I am creating pivot tables in VB.NET and have run into a problem I did not think would be as difficult as it is turning out. When I create a pivot table it adds in subtotals for each row and I do not want that. In excel you just drag down the subtotals option and tell it to not display subtotals. I looked into the VBA for it and it is several lines long of this format:

     ActiveSheet.PivotTables("Main Highway Pivot").PivotFields("Division"). _
    Subtotals = Array(False, False, False, False, False, False, False, False, False, False, _
    False, False)

This is a surprising amount of code, but that is fine, so I have been trying something similar with my pivot table in VB.NET

With ptTable
.ManualUpdate = True
.PivotFields("Division").orientation = Excel.XlPivotFieldOrientation.xlRowField
.PivotFields("Net Sales Amt").orientation = Excel.XlPivotFieldOrientation.xlDataField
.PivotFields("Division").Subtotals = false
.ColumnGrand = False
.RowGrand = True
.ManualUpdate = False
End With

I have tried several different variations of the

 .PivotFields("Division").Subtotals = false

line, but have had little luck. Is this the right code and I am specifying the false part wrong? Why is there no

.subtotal = false

to make this easier?

In any case, it seemed like something simple to me, but after a good bit of digging I am not sure how to fix it, so any help would be appreciated.

Thank you as always SO

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T04:11:44+00:00Added an answer on June 3, 2026 at 4:11 am

    Here’s a snippet of VBA (from http://www.pcreview.co.uk/forums/hide-subtotals-rowfields-pivot-table-t974940.html) which might help:

    '=========================
    Sub NoSubtotals()
    'turns off subtotals in pivot table
    '.PivotFields could be changed to
    '.RowFields or .ColumnFields
    Dim pt As PivotTable
    Dim pf As PivotField
    On Error Resume Next
    For Each pt In ActiveSheet.PivotTables
    For Each pf In pt.PivotFields
    'First, set index 1 (Automatic) to True,
    'so all other values are set to False
    pf.Subtotals(1) = True
    pf.Subtotals(1) = False
    Next pf
    Next pt
    End Sub
    '========================
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

A little help needed, I have a Macro automatically creating pivot tables and charts,
I have a problem with creating a pivot table in PostgreSQL using the crosstab()
Hey I have some problems creating my query into doctrine: My sql query looks
Creating an installer for possible remote systems so that if they do not have
I have connected Oracle to Access, and I have been having fun creating pivot
I am creating a pivot table excel sheet in my ASP .NET web application
Creating liquid layouts is an immense pain. Now, I totally understand that tables should
Creating a JApplet I have 2 Text Fields, a button and a Text Area.
Creating a table without tbody using javascript createElement/appendChild will not add tbody in Firebug
Creating extensions got much easier with Vs2010, but this seems not to be the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.