LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Resizing Pivot table column

Hi,

A bit of a newbie question. I've got to write a macro that will refresh
all the Pivot tables, spread over a large number of worksheets, in a
workbook & then to print them. That bit I've managed to do using :-

<code
Dim ws As Worksheet
Dim row As Integer
Dim PivotList As Integer
Dim X As Integer

row = 2

Sheets("Print Pivots").Select ' this worksheet contains a list of
the worksheets that need updating
' Loop through worksheets that need printing
Do Until Cells(row, 1).Value = ""
Set ws = Worksheets(Cells(row, 1).Value)
ws.Select


' Get the number of Pivot tables on the worksheet
PivotList = ActiveSheet.PivotTables.Count
' Update each Pivot table in the worksheet
For X = 1 To PivotList
ws.PivotTables(X).PivotCache.Refresh
Next

ActiveSheet.PrintOut
'ws.PrintPreview '- use for testing


'get next pivot table location
Sheets("Print Pivots").Select
row = row + 1
Loop
</code

However one of the Pivot Tables has more data in the same column
beneath it & after the refresh the column width shrinks to fit the
Pivot Table & this other data appears as #########. Any ideas on the
best way of retaining the original column's width?

Thanks in advance,

Andee

 
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
Sorting a Pivot Table Column that is not the first column... [email protected] Excel Worksheet Functions 1 October 10th 07 09:02 PM
Resizing a pivot column based on Field Name cmungall Excel Programming 2 May 20th 06 01:39 AM
Prevent Pivot Table Resizing M. Wirtzfeld Excel Programming 0 November 12th 05 09:27 PM
Column Resizing and Pivot Tables Schmeebs Excel Discussion (Misc queries) 1 May 11th 05 02:11 AM
Pivot Table Resizing Todd Huttenstine Excel Programming 1 April 1st 04 03:22 PM


All times are GMT +1. The time now is 06:35 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"