Processing
 

Buggy PivotTable.ColumnRange

01/09/2016 14:14#1

Joined at: 10 months ago

Post: 7

Thank: 0

Thanked: 0

I get "Unable to get the ColumnRange property of the PivotTable class" error when I try to get columnRange of a pivot table with only one value column and without column headers (like in the picture below).

Buggy PivotTable.ColumnRange

However if the pivot table has multiple columns, like in the picture below, it works correctly.

Buggy PivotTable.ColumnRange

To test it, I've just used small code below, in first case both .ColumnRange and DataLabelRange has failed, and in second case all worked correctly. Is this a bug or is there any logic behind?

Sub testPivotRanges()     Dim pt As PivotTable      Set pt = ActiveSheet.PivotTables(1)     On Error Resume Next      Debug.Print "pt.ColumnRange.Address : " & pt.ColumnRange.Address     Debug.Print "pt.RowRange.Address : " & pt.RowRange.Address     Debug.Print "pt.DataBodyRange.Address : " & pt.DataBodyRange.Address     Debug.Print "pt.DataLabelRange.Address : " & pt.DataLabelRange.Address End Sub 
Similar articles

Excel More conditions in one formula?

4 months ago - Reply: 2 - Views: 171

Get Workbook reference from Open File dialog

4 months ago - Reply: 2 - Views: 128

Add Calculated Field To Pivot Table

4 months ago - Reply: 0 - Views: 5

Nested IF Functions in Excel not working

4 months ago - Reply: 3 - Views: 163

Formulating Date in Excel 2013

5 months ago - Reply: 2 - Views: 88

VB6 extracts in Excel 2013

5 months ago - Reply: 2 - Views: 153

Excel 2013 : Pull Matching Data from Column

5 months ago - Reply: 1 - Views: 19

excel search and copy in/from another file

5 months ago - Reply: 0 - Views: 1

Buggy PivotTable.ColumnRange

5 months ago - Reply: 0 - Views: 4

Excel static conditional formatting area

5 months ago - Reply: 0 - Views: 8

vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re