If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Excel > VBA to unhide all pivot itmes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-18-06, 05:58
Feitje Feitje is offline
Registered User
 
Join Date: Apr 2005
Posts: 39
VBA to unhide all pivot itmes

Hi. Does anny one know what it wrong wit this code. It bugs at the visible = true line...

Thanks Felix

================================================== ===
Sub Pivotgroupall()
On Error GoTo err_handler
' Unhide all items
Sheets(Dataworksheet).Select
Dim NameofItem As String

Pivotname = "Pivottable1"
Fieldname = "CATEGORY"

With ActiveSheet.PivotTables(Pivotname).PivotFields(Fie ldname)

For x = 1 To .PivotItems.Count
NameofItem = .PivotItems(x).Name
If .PivotItems.Item(NameofItem).Visible = False Then
.PivotItems(NameofItem).Visible = True
End If
Next
End With
Sheets("REPORT").Select

err_handler:
Application.ScreenUpdating = True
MsgBox Error_text & Err.Number & Err.Description, vbCritical
End Sub
================================================== ===
Reply With Quote
  #2 (permalink)  
Old 09-19-06, 08:20
Feitje Feitje is offline
Registered User
 
Join Date: Apr 2005
Posts: 39
for who is intrested, I found the solution browsing on internet:

http://www.mrexcel.com/board2/viewto...ight=pivotitem

seems like you need to sort the pivotitems before you can thouch the pivotitem class....
Reply With Quote
  #3 (permalink)  
Old 09-19-06, 21:43
shades shades is offline
Registered User
 
Join Date: Oct 2003
Posts: 1,091
I commend you for this. You continued searching on your own. You also came back here and provided a link to the solution, then gave the critical factor in solving the issue.

Well done!!!
__________________
old, slow, and confused
but at least I'm inconsistent!

Rich
(retired Excel 2003 user, 3/28/2008)

How to ask a question on forums
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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