LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
mju mju is offline
external usenet poster
 
Posts: 29
Default Pivot table Macro help!!!

I am new to working with pivot table /macro
I have a pivot table. The total columns are always changing.

How do I declare a variable in the data source to find the last used column?
Hard coding it will not help me.

Data can range from A:BD or A:AR. It all depends.

Thanks a lot.

Below is a copy of my code.

CELLS.Select
ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatab ase, SourceData:= _
"'full'!A:BD").CreatePivotTable TableDestination:="", TableName:= _
"PivotTable4", DefaultVersion:=xlPivotTableVersion10
ActiveSheet.PivotTableWizard TableDestination:=ActiveSheet.CELLS(3, 1)
ActiveSheet.CELLS(3, 1).Select
With ActiveSheet.PivotTables("PivotTable4")
.ColumnGrand = False
.RowGrand = False
End With

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Looking to remove pivot fields from pivot table via macro S Himmelrich Excel Programming 0 January 16th 09 03:49 PM
Macro on filtering pivot table (pivot fields) = debug markx Excel Programming 2 May 28th 08 09:32 AM
Code for a Macro that allows a Pivot table to be repeatedly run (fora dynamic rows in a table, but static field names) Mike C[_5_] Excel Programming 1 February 11th 08 04:30 AM
Pivot Table Macro BCNU Excel Discussion (Misc queries) 0 November 14th 06 01:33 AM
Steps from Macro recorder for Pivot table will not run as a Macro Nancy[_5_] Excel Programming 0 April 2nd 04 10:33 PM


All times are GMT +1. The time now is 05:49 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"