Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default How to remove "(All)" from pivot table using VBA

hi everyone!
does anyone know if it is possible to remove the "(All)"
or "(Show All)" from a pivot table.

here's a piece of my code for setting up the first
element of each pagefeild items, but I would also want to
remove the field "(All)"

With ActiveWorkbook.PivotCaches.Add
(SourceType:=xlExternal)
.Connection = strConnection
.CommandType = xlCmdSql
.CommandText = "exec
fc_GetViewAsDenormalizedTable @View_id=" & intViewID & ",
@tableset=" & intTableset
.CreatePivotTable
TableDestination:=ActiveSheet.Range("A3"),
TableName:="PivotTable1",
DefaultVersion:=xlPivotTableVersion10
End With

Set pt = ActiveSheet.Range("A3").PivotTable

For Each ptField In pt.PivotFields
If LCase(ptField.Name) < "data_id" And LCase
(ptField.Name) < "usertable_login" And LCase
(ptField.Name) < "view_id" And LCase(ptField.Name)
< "transfert_date" And LCase(ptField.Name)
< "control_code" Then
Select Case LCase(ptField.Name)
Case "cou"
ptField.Orientation = xlRowField
Case "country"
ptField.Orientation = xlRowField
Case "dcountry"
ptField.Orientation = xlRowField
Case "yea"
ptField.Orientation = xlColumnField
Case "year"
ptField.Orientation = xlColumnField
Case "data_value"
pt.AddDataField ptField
Case Else
ptField.Orientation = xlPageField
strFirstMember = ptField.PivotItems(1)
ptField.CurrentPage = strFirstMember
End Select
End If
Next ptField

pt.RowGrand = False
pt.ColumnGrand = False
pt.NullString = ".."

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
Create Pivot Table Data with Column "Sum" rather than "count" defa Johnny_99[_2_] Excel Discussion (Misc queries) 2 January 2nd 10 03:25 PM
Pivot Table Report Filter - "OR" instead of "AND" Multiple Filters tommcbrny Excel Discussion (Misc queries) 1 October 29th 09 03:08 AM
Remove "sum of" from pivot table name large quantities FSUKC Excel Discussion (Misc queries) 1 October 6th 06 02:36 AM
Pivot Table - Remove "sum of" in data field abgmclt Excel Discussion (Misc queries) 2 May 26th 06 08:22 PM
Remove "(blank)" in a pivot table? GunnarX Excel Discussion (Misc queries) 2 March 9th 06 09:07 PM


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