ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Name of the current pivottable from active cell (https://www.excelbanter.com/excel-programming/405596-name-current-pivottable-active-cell.html)

[email protected]

Name of the current pivottable from active cell
 
hi,

I need a macro to resize the column of the **current** pivot table.
All the code sample I have found suppose that you already have the
name of the pivot table to apply any modification.

Is there a way to find the current pivot table from the active cell ?



Here is the code I need to modify:

ActiveSheet.PivotTables("Tableau croisé dynamique1").PivotSelect
"", _
xlDataAndLabel
Selection.ColumnWidth = 9


Thank you for your help

François

ryguy7272

Name of the current pivottable from active cell
 
Try this utility:

http://www.contextures.com/xlPivotPlay01.html


Regards,
Ryan--

--
RyGuy


" wrote:

hi,

I need a macro to resize the column of the **current** pivot table.
All the code sample I have found suppose that you already have the
name of the pivot table to apply any modification.

Is there a way to find the current pivot table from the active cell ?



Here is the code I need to modify:

ActiveSheet.PivotTables("Tableau croisé dynamique1").PivotSelect
"", _
xlDataAndLabel
Selection.ColumnWidth = 9


Thank you for your help

François


[email protected]

Name of the current pivottable from active cell
 
Hi,

Thank you Ryan, but I have finally found the solution (at least, **a**
solution):



ActiveCell.CurrentRegion.ColumnWidth = 9



Simple, clear, efficient :-)

Thanks for your answer, I will have a look at your utility if I am in
need of further features.

Regards

François


All times are GMT +1. The time now is 10:48 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com