+ Reply to Thread
Results 1 to 5 of 5

programmatic grouping of columns in pivot table

  1. #1
    Jerry
    Guest

    programmatic grouping of columns in pivot table

    I've built a pivot table programmatically in VB.net using the Excel OM . The
    columns of the table are Jan, Feb, Mar, etc. and I would like to group them
    programmatically into Quarters also but can't figure out what the code should
    be. I'd also like to have subtotals for the Quarters. Can someone provide the
    code for this or point me to something that would help?

    Thanks,

    Jerry

  2. #2
    Jim Thomlinson
    Guest

    RE: programmatic grouping of columns in pivot table

    Are your dates just the months, or are they actual dates? If they are actual
    dates then you just need to change your grouping to include, Quarters and
    Years... Teh Pivot Table engine changed in xl2002, so any code would have to
    be written for your version of Excel. You could just record a macro if you
    have actual dates. If you do not have actual dates then you are going to have
    to do some programming to add a dimension (column) to your source data with
    indicates the quarter, based on the month.
    --
    HTH...

    Jim Thomlinson


    "Jerry" wrote:

    > I've built a pivot table programmatically in VB.net using the Excel OM . The
    > columns of the table are Jan, Feb, Mar, etc. and I would like to group them
    > programmatically into Quarters also but can't figure out what the code should
    > be. I'd also like to have subtotals for the Quarters. Can someone provide the
    > code for this or point me to something that would help?
    >
    > Thanks,
    >
    > Jerry


  3. #3
    Jerry
    Guest

    RE: programmatic grouping of columns in pivot table



    "Jim Thomlinson" wrote:

    > Are your dates just the months, or are they actual dates? If they are actual
    > dates then you just need to change your grouping to include, Quarters and
    > Years... Teh Pivot Table engine changed in xl2002, so any code would have to
    > be written for your version of Excel. You could just record a macro if you
    > have actual dates. If you do not have actual dates then you are going to have
    > to do some programming to add a dimension (column) to your source data with
    > indicates the quarter, based on the month.
    > --
    > HTH...
    >
    > Jim Thomlinson
    >
    >
    > "Jerry" wrote:
    >
    > > I've built a pivot table programmatically in VB.net using the Excel OM . The
    > > columns of the table are Jan, Feb, Mar, etc. and I would like to group them
    > > programmatically into Quarters also but can't figure out what the code should
    > > be. I'd also like to have subtotals for the Quarters. Can someone provide the
    > > code for this or point me to something that would help?
    > >
    > > Thanks,
    > >
    > > Jerry


    Jim,

    The columns are just month abbreviations. If I grouping manually in a pivot
    table I can group by months, quarters and even get subtotals by quarters.
    I've tried recording a macro for these clicks but the code I get from the
    macro just doesn't seem to work in VB.net. I was hoping you might have some
    code that actually does grouping of columns. Any help would be appreciated.

    I could format the columns for something like 1/31/06, 2/28/06 ... If I did
    that I still don't know how to program the gouping. Can you help with that?
    I'm using Excel 2003 and VB.net (Visual Studio 2005)

    Thanks,
    jerry


  4. #4
    Jim Thomlinson
    Guest

    RE: programmatic grouping of columns in pivot table

    My .net is thin and I only have xl2k here at work, so I will not be a lot of
    help with code. Debra Dagliesh has an excellent site on pivot table
    programming...

    http://www.contextures.com/

    She is the Guru in this area.
    --
    HTH...

    Jim Thomlinson


    "Jerry" wrote:

    >
    >
    > "Jim Thomlinson" wrote:
    >
    > > Are your dates just the months, or are they actual dates? If they are actual
    > > dates then you just need to change your grouping to include, Quarters and
    > > Years... Teh Pivot Table engine changed in xl2002, so any code would have to
    > > be written for your version of Excel. You could just record a macro if you
    > > have actual dates. If you do not have actual dates then you are going to have
    > > to do some programming to add a dimension (column) to your source data with
    > > indicates the quarter, based on the month.
    > > --
    > > HTH...
    > >
    > > Jim Thomlinson
    > >
    > >
    > > "Jerry" wrote:
    > >
    > > > I've built a pivot table programmatically in VB.net using the Excel OM . The
    > > > columns of the table are Jan, Feb, Mar, etc. and I would like to group them
    > > > programmatically into Quarters also but can't figure out what the code should
    > > > be. I'd also like to have subtotals for the Quarters. Can someone provide the
    > > > code for this or point me to something that would help?
    > > >
    > > > Thanks,
    > > >
    > > > Jerry

    >
    > Jim,
    >
    > The columns are just month abbreviations. If I grouping manually in a pivot
    > table I can group by months, quarters and even get subtotals by quarters.
    > I've tried recording a macro for these clicks but the code I get from the
    > macro just doesn't seem to work in VB.net. I was hoping you might have some
    > code that actually does grouping of columns. Any help would be appreciated.
    >
    > I could format the columns for something like 1/31/06, 2/28/06 ... If I did
    > that I still don't know how to program the gouping. Can you help with that?
    > I'm using Excel 2003 and VB.net (Visual Studio 2005)
    >
    > Thanks,
    > jerry
    >


  5. #5
    Jerry
    Guest

    RE: programmatic grouping of columns in pivot table



    "Jim Thomlinson" wrote:

    > My .net is thin and I only have xl2k here at work, so I will not be a lot of
    > help with code. Debra Dagliesh has an excellent site on pivot table
    > programming...
    >
    > http://www.contextures.com/
    >
    > She is the Guru in this area.
    > --
    > HTH...
    >
    > Jim Thomlinson
    >
    >
    > "Jerry" wrote:
    >
    > >
    > >
    > > "Jim Thomlinson" wrote:
    > >
    > > > Are your dates just the months, or are they actual dates? If they are actual
    > > > dates then you just need to change your grouping to include, Quarters and
    > > > Years... Teh Pivot Table engine changed in xl2002, so any code would have to
    > > > be written for your version of Excel. You could just record a macro if you
    > > > have actual dates. If you do not have actual dates then you are going to have
    > > > to do some programming to add a dimension (column) to your source data with
    > > > indicates the quarter, based on the month.
    > > > --
    > > > HTH...
    > > >
    > > > Jim Thomlinson
    > > >
    > > >
    > > > "Jerry" wrote:
    > > >
    > > > > I've built a pivot table programmatically in VB.net using the Excel OM . The
    > > > > columns of the table are Jan, Feb, Mar, etc. and I would like to group them
    > > > > programmatically into Quarters also but can't figure out what the code should
    > > > > be. I'd also like to have subtotals for the Quarters. Can someone provide the
    > > > > code for this or point me to something that would help?
    > > > >
    > > > > Thanks,
    > > > >
    > > > > Jerry

    > >
    > > Jim,
    > >
    > > The columns are just month abbreviations. If I grouping manually in a pivot
    > > table I can group by months, quarters and even get subtotals by quarters.
    > > I've tried recording a macro for these clicks but the code I get from the
    > > macro just doesn't seem to work in VB.net. I was hoping you might have some
    > > code that actually does grouping of columns. Any help would be appreciated.
    > >
    > > I could format the columns for something like 1/31/06, 2/28/06 ... If I did
    > > that I still don't know how to program the gouping. Can you help with that?
    > > I'm using Excel 2003 and VB.net (Visual Studio 2005)
    > >
    > > Thanks,
    > > jerry
    > >


    Okay, thanks...

    jerry


+ Reply to Thread

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