ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   programmatic grouping of columns in pivot table (https://www.excelbanter.com/excel-programming/354065-programmatic-grouping-columns-pivot-table.html)

Jerry

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

Jim Thomlinson[_5_]

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


Jerry

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


Jim Thomlinson[_5_]

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


Jerry

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



All times are GMT +1. The time now is 03:39 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com