LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
CM CM is offline
external usenet poster
 
Posts: 136
Default macro skips a command

I have a button that runs the following codle. All of it works as intended
excpet the two lines that attempt to set the column widths of range named
'widthselection' to 18, after the pivot table has been refreshed.

Would like some advice, please.

Application.DisplayAlerts = False
With Sheets("Summaries")
.Unprotect Password:="topSecret"
Sheets("Summaries").PivotTables("PivotTable2").Piv otCache.Refresh
Dim pt As PivotTable
Dim ws As Worksheet
Dim pc As PivotCache
For Each ws In ActiveWorkbook.Worksheets
For Each pt In ws.PivotTables
pt.PivotCache.MissingItemsLimit = xlMissingItemsNone
Next pt
Next ws
For Each pc In ActiveWorkbook.PivotCaches
On Error Resume Next
pc.Refresh
Next pc
Range("widthselection").Select
Selection.ColumnWidth = 18
.Protect Password:="topSecret"
End With
--

cm
 
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
Loop Skips Data - Why? Walter Excel Programming 7 October 24th 08 02:52 PM
skips controls JT Excel Programming 1 June 21st 08 06:51 PM
Macro deletes row in range, macro then skips the row moved up steven.holloway Excel Discussion (Misc queries) 8 June 11th 08 11:40 AM
How do I set it so my tab key skips to the next cell not 6? twassyouth Excel Discussion (Misc queries) 2 October 15th 07 10:29 PM
Amortization with up front skips kmagolden Excel Worksheet Functions 1 October 26th 06 12:06 AM


All times are GMT +1. The time now is 09:36 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"