Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 69
Default Attn: Barb Reinhardt

Barb, I am reposting this today in an attempt to contact you. I am assuming
the discussion board does not monitor old strings. If your still out there, I
hope we can get back on this.

I added this code to my workbook and tried it. I get a run time error
1004 (Unable to set the _Default property of the Pivotitem class) when I
debug the line of code highlighted is "myPivotField.CurrentPage =
myPivotItem.Value"

thanks for your help to this point.
Peter

"Barb Reinhardt" wrote:

Oops, try this

Sub Filter_Rep()
Dim aWS As Worksheet
Dim newWS As Worksheet
Dim myWB As Workbook
Dim myWS As Worksheet
Dim myPivotItem As PivotItem

Set aWS = ActiveSheet

For Each myPivotField In aWS.PivotTables("PivotTable1").PivotFields
Debug.Print myPivotField.Name
If myPivotField.Name = "Rep." Then
For Each myPivotItem In myPivotField.PivotItems
Debug.Print myPivotItem.Value
If Not myPivotItem.Value = "(blank)" Then
myPivotField.CurrentPage = myPivotItem.Value
Set myWB = Workbooks.Add
Set myWS = myWB.Worksheets(1)
myWS.Range(aWS.UsedRange.Address) = aWS.UsedRange
Debug.Print aWS.UsedRange.Address
aWS.UsedRange.Copy
myWS.PasteSpecial
End If
Next myPivotItem
End If
Next myPivotField
End Sub
--
HTH,
Barb Reinhardt


Reply
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
Barb - don't worry, I got it working...you are a lifesaver!!!!!!.t James T Excel Programming 1 August 24th 07 03:06 AM
for Toppers and Barb yodochi Excel Worksheet Functions 3 July 25th 07 12:57 PM
Attn: Tom Ogilvy (Please) Teerings3[_9_] Excel Programming 3 December 13th 05 04:16 AM
Barb Reinhardt: HOW TO: Plot a Team Name .... Kevin McCartney Charts and Charting in Excel 2 December 1st 04 01:28 PM
ATTN: KEEPITCOOL pk Excel Programming 4 November 25th 03 11:21 PM


All times are GMT +1. The time now is 01:16 PM.

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"