Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / February 2006

Tip: Looking for answers? Try searching our database.

programmatic grouping of columns in pivot table

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jerry - 22 Feb 2006 18:34 GMT
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 - 22 Feb 2006 18:58 GMT
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.
Signature

HTH...

Jim Thomlinson

> 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
[quoted text clipped - 5 lines]
>
> Jerry
Jerry - 22 Feb 2006 19:13 GMT
> 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
[quoted text clipped - 13 lines]
> >
> > 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 - 22 Feb 2006 20:11 GMT
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.
Signature

HTH...

Jim Thomlinson

> > 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
[quoted text clipped - 28 lines]
> Thanks,
> jerry
Jerry - 22 Feb 2006 20:20 GMT
> 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
[quoted text clipped - 36 lines]
> > Thanks,
> > jerry

Okay, thanks...

jerry
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.