
System = Excel 2003, VB 6.3, Pent 4 2.9 ghz, 1.5 GB RAM, 21 GB free on HD (out of 40GB total)
I have a spreadsheet that has about 10 tabs.
To update each pivotable in each tab, I run the following code.
At the same time, I want to readjust the column sizes (after updating the pivots, they expand too much due to header) This is where the problem lies.
The Code will allow me to Step through it successfully, the columns resize, but will not RUN correctly!
Here is the simple code:
Sub AllWorkbookPivots()
Dim pt As PivotTable
Dim WS As Worksheet
For Each WS In ActiveWorkbook.Worksheets
For Each pt In WS.PivotTables
pt.RefreshTable
Next pt
' Auto Formats the Column Widths
Call ColumnsAutoWidthAdjustments
WS.Activate
Next WS
End Sub
Sub ColumnsAutoWidthAdjustments()
' ColumnsAutoWidthAdjustments Macro
' Keyboard Shortcut: Ctrl+Shift+W
Cells.Select
Range("a1").Activate
Selection.Columns.AutoFit
Range("B2").Select
End Sub
Any help would be greatly appreciated!
Bookmarks