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 / New Users / July 2006

Tip: Looking for answers? Try searching our database.

Pivot and columns order

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Tewari - 28 Jul 2006 18:45 GMT
Can I change the order of the columns before/after the creation of the
pivot using VBA>BY order of columns I mean If I have Total Last Year,
Total This Year, Jan2006,Feb2006,...,June2006,July2006 as the columns
in pivot then can I make them to appear as
Jan2006,Feb2006,...,June2006,July2006 ,Total This Year,Total Last Year
If there is any confusion pl write me back , I will send you the exact
Pivot.
Also is it possible to remove some of the  columns from Pivots?
I want to use VBA to do it.
Excelenator - 28 Jul 2006 22:45 GMT
Assuming you only have the 9 columns you laid out in your example yo
can use this code.  You would have to adjust the .Position = *-[tota
num cols]-* if they differ.

Code
-------------------
   With ActiveSheet.PivotTables("PivotTable1").PivotFields("Total This Year")
 .Orientation = xlColumnField
 .Position = 9
 End With
 With ActiveSheet.PivotTables("PivotTable1").PivotFields("Total Last Year")
 .Orientation = xlColumnField
 .Position = 9
 End Wit
-------------------

Tewari Wrote:
> Can I change the order of the columns before/after the creation of the
> pivot using VBA>BY order of columns I mean If I have Total Last Year,
[quoted text clipped - 5 lines]
> Also is it possible to remove some of the  columns from Pivots?
> I want to use VBA to do it

--
Excelenato
 
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.