Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 67
Default Pivot Tables: Hide detail for a RowField via code: Get an Error?

Hi TWIMC

I get the following error '1004: unable to set the ShowDetail property of
the Range class' when I try to hide the details for a particular RowField in
my pivot table. The line of code that causes the error is ws.Cells(rge.Row,
rge.Column).ShowDetail = False (4th from bottom), anway I'm not sure why
because if I record a macro in Excel when I do it manully I get the code.

Selection.ShowDetail = False

Thus I tried to implement it programitically and look at each RowField one
by one and if for that RowField in the same column but in row 1, if the cell
value was HIDE I wanted to set the RowField to ShowDetail = False

This is the code I used:

For Each pfd In pt.RowFields
' For any fields that are used in the row area and need
to be set to HIDE DETAIL,
For Each rge In pt.RowRange
' find cells in row 1 where the value is HIDE ans set
accordingly.
If pfd.Name = ws.Cells(rge.Row, rge.Column).Value And
ws.Cells(1, rge.Column).Value = "HIDE" Then


ws.Cells(rge.Row, rge.Column).ShowDetail = False


End If
Next rge
Next pfd

The error message that I get is '1004: unable to set the ShowDetail property
of the Range class'

not sure and I haven't bee able to figure it out yet but I'm hoping someone
out there can.

Any help, very much appreciated.

TIA
KM
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
group and show detail in pivot tables audimiko Excel Discussion (Misc queries) 0 February 2nd 09 10:39 PM
Anyone seen Pivot Tables with incorrect detail but correct total? mickee Excel Discussion (Misc queries) 0 July 17th 06 08:25 PM
how do i only see subtotals in a pivot and hide the detail GGG Excel Worksheet Functions 1 October 27th 05 07:33 AM
Pivot table - hide detail for column kbear Excel Discussion (Misc queries) 0 March 22nd 05 07:11 PM
Pivot Tables: Unable to Group and Show Detail [email protected] Excel Discussion (Misc queries) 6 January 14th 05 09:47 PM


All times are GMT +1. The time now is 11:12 AM.

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"