LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,582
Default Find the End of a Pivot table

To select the last cell of the pivot table:

Sub GetLastPTCell()
Dim rLastCell As Range
With ActiveSheet.PivotTables(1).TableRange1
Set rLastCell = .Offset(.Rows.Count - 1, .Columns.Count - 1).Resize(1,
1)
End With

rLastCell.Select

End Sub


- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


"Looping through" wrote in
message ...
Jon, thanks for the responce, but the last cell of my pivot table was not
found. The code runs but the active cell does not get selected.

I added ActiveCell.Offset(0, -1).Range("A1").Select to your code to test.
this works but the active cell selected at the top of the PT not the
bottom.

Peter

"Jon Peltier" wrote:

Sub GetLastPTCell()
Dim rLastCell As Range
With ActiveSheet.PivotTables(1).TableRange1
Set rLastCell = .Offset(.Rows.Count - 1, .Columns.Count -
1).Resize(1,
1)
End With
End Sub

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


"Looping through" wrote in
message ...
I need to find the end of a Pivot table I call "Won" the table sorts
orders
out and is constantly growing. I need to find the last cell of that
table
at
any given time after it is filtered so I can add some notes and other
info
to
the bottom. I have tried range names but when the table grows it
consumes
my
Range Name as well. Can the cell with the range name move with the
growing
table?

thanks
Peter






 
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
Pivot Table Find outside source Robert_DubYa Excel Discussion (Misc queries) 1 April 17th 09 03:09 PM
Find function Pivot Table dinadvani via OfficeKB.com Excel Discussion (Misc queries) 1 April 30th 08 02:58 PM
newbie pivot table question (using match to find a value) Keith R Excel Discussion (Misc queries) 1 May 1st 07 03:38 PM
pivot table - trying to find A OR B instead of A AND B data analyst Excel Discussion (Misc queries) 1 March 14th 07 12:03 AM
How to find the current pagefield of a pivot table? Tama Excel Programming 0 December 22nd 03 05:00 AM


All times are GMT +1. The time now is 03:40 AM.

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

About Us

"It's about Microsoft Excel"