Düzenle

Aracılığıyla paylaş


PivotTable.SmallGrid property (Excel)

True if Microsoft Excel uses a grid that's two cells wide and two cells deep for a newly created PivotTable report. False if Excel uses a blank stencil outline. Read/write Boolean.

Syntax

expression.SmallGrid

expression A variable that represents a PivotTable object.

Remarks

You should use the stencil outline. The grid is provided only because it enables compatibility with earlier versions of Excel.

Example

This example creates a new PivotTable cache based on an OLAP provider, and then it creates a new PivotTable report based on this cache at cell A3 on the active worksheet. The example uses the stencil outline instead of the cell grid.

With ActiveWorkbook.PivotCaches.Add(SourceType:=xlExternal) 
 .Connection = _ 
 "OLEDB;Provider=MSOLAP;Location=srvdata;Initial Catalog=National" 
 .MaintainConnection = True 
 .CreatePivotTable TableDestination:=Range("A3"), _ 
 TableName:= "PivotTable1" 
End With 
With ActiveSheet.PivotTables("PivotTable1") 
 .SmallGrid = False 
 .PivotCache.RefreshPeriod = 0 
 With .CubeFields("[state]") 
 .Orientation = xlColumnField 
 .Position = 0 
 End With 
 With .CubeFields("[Measures].[Count Of au_id]") 
 .Orientation = xlDataField 
 .Position = 0 
 End With 
End With

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.