Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Hide column in Pivot table

Hi All,

I have the below Pivot table where I have generated dates which isn't available in my DB. The row is getting added(in here 10/19/2017) along with a column full of 0's. Is there a way to hide the column with 0's alone?

   

Cdate/LOBManualAutoReferred
10/21/201710000
10/20/2017103500
10/19/20170000
10/18/201767660
10/17/201707800
10/16/201789080

I did find this macro which says that we can hide the colum . Could you please let me know how exactly this works? or is there any other way?

sub Squeeze
call HideColumn("CH01", 2)
end sub
'
private sub HideColumn(ch, n)
set ch = ActiveDocument.GetSheetObject(ch)
ch.SetPixWidth (n-1), 0
end sub

Any help will be much appreciated.

Thanks,

Anupama Jagan

22 Replies
MarcoARaymundo
Creator III
Creator III

Hi! this not possible

atoz1158
Creator II
Creator II

Hi

You cannot hide a column in a Pivot Table as you can in a Straight Table, if you do not need to use a Pivot Table converted it into a Straight Table and then on the Presentation tab for the table properties you will have an option to Hide the Column.

The best you can do in a Pivot Table is to set the background and foreground colours to be the same for that column and make its width as small as possible.

Regards

Adrian

Anonymous
Not applicable
Author

But how to change the colour and width for that column alone? because its doesn't have any LOB attached to it. It just pops up only cos I have generated the missing dates ...

Anil_Babu_Samineni

Does this macro using any button?

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Anonymous
Not applicable
Author

I don't have any information regarding this macro. When I searched for this problem in this below link..

Pivot Column Width to Zero

MarcoARaymundo
Creator III
Creator III

There is no width control per column, even though the column does not have zero width.

You can change the color to the same from the background.

Anil_Babu_Samineni

Would you like to go macro code using button in extra object?

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Anonymous
Not applicable
Author

Is it not possible otherwise? because the requirement is on opening the document the table should all dates but without that extra 0 column..

pradosh_thakur
Master II
Master II

Well there is a possibility. Give it  a try.

1: go to the expression for that column

2: check conditional show

3: set condition 1=0

regards

Pradosh

Learning never stops.