• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Slicer click to retain row height VBA

Hello everyone,

Could you please provide me code to specify row height of a pivot table as it keeps changing the moment we click on a slicer.

Thank You and Regards,
Pavan.
 
No need for VBA here. Just set PivotTable option to preserve cell formatting on update (you may need to untick Autofit column widths on update).

As well, you'd likely want to disable word wrap in row headers.
 
Thank you for the reply Chihiro. However, it is not working and I have tried the same way. So, requesting for a code which would work by clicking on the slicer items as part of slicer cache.

Regards,
Pavan.
 
Upload sample workbook. Without it, there isn't much I can help with. As pivot table code will largely depend on your table structure and how the pivot table was built (using OLAP or regular Excel Table/Range etc).
 
After the click on silcer, the data should be presented with a row height of 20 in the below table which is the requirement please.

Thank You and Regards,
Pavan.
 

Attachments

  • Sample_Pivot.xlsx
    576 KB · Views: 2
20 what? Pixel or points?

At any rate, you issue was Word Wrap being turned on. If you turn off word wrap, row height is respected and kept to whatever you set it at.
 

Attachments

  • Sample_Pivot.xlsx
    575.7 KB · Views: 2
Thank you for the reply. I tried that its working only once or twice later on its getting to its normal row height of autofit. So, kindly help.

Regards,
Pavan.
 
That should not happen. If you turned off word wrap for entire Pivot Table row label range.

Make sure you remove selection from Slicer, and take off Word Wrap from all applicable range and test.

If the issue persist, point out exactly when it fails, so I can replicate issue and address it.
 
Back
Top