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: 36
Default Select all pivot table areas/ranges on the active sheet problem

Greetings all!

Excel 2000 & Windows 2000
I've been working on this for several hours and have searched the
archive with no apparent luck.
What I'm trying to do is return all the ranges (TableRange2) of 1..nth
pivot tables
on an active sheet to an array. Then the procedure selects the range
represented by the array.

I keep getting Run Time error 424 object required. I think the error
refers to
ActiveSheet.PivotTables(i).TableRange2.Address. But this is a valid
range reference as far
I know. Also, I would like this procedure to work on sheets where the
number and names of the
pivot tables are not known.

Any thoughts?
Thank you for any insight you may provide.
Tom


Sub SelectAllPivotTableAreas()

'Select all pivot table areas on the active sheet

Dim i As Integer
Dim rng As Range
On Error Resume Next

With ActiveSheet
For i = 1 To .PivotTables.Count
.PivotTables(i).TableRange2.Select
If rng Is Nothing Then
Set rng =
ActiveSheet.PivotTables(i).TableRange2.Address
Else
Set rng = Union(rng,
ActiveSheet.PivotTables(i).TableRange2.Address)
End If
Next i
End With
rng.Select

End Sub
 
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
Row select mode to highlight active row of active cell Bart Fay[_2_] Excel Discussion (Misc queries) 0 May 11th 10 09:34 PM
Pivot table active dropdown rickdluc Excel Worksheet Functions 5 September 3rd 08 08:23 AM
How to set printer default to select active sheet not whole book Vic Storey Excel Discussion (Misc queries) 0 May 16th 08 06:11 PM
How to select the active sheet? Eric Excel Worksheet Functions 1 August 7th 07 03:40 PM
Select First Active Cell if the cell is in a pivot table Don Excel Programming 0 June 30th 04 01:53 PM


All times are GMT +1. The time now is 11: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"