Question : Macro freezes Excel.  Desperate!

I ran a macro to format my pivot tables and placed the code behind each named pivot tab.  I have 6 pivot tables with different formats.  However, it keeps freezing in the midde of the run on the last 3.  Nothing different on each except column width and no. of columns.

Code Snippet:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
143:
144:
145:
146:
147:
148:
149:
150:
151:
152:
153:
154:
155:
156:
157:
158:
159:
160:
161:
162:
163:
164:
165:
166:
167:
168:
169:
170:
171:
172:
173:
174:
175:
176:
177:
178:
179:
180:
181:
182:
183:
184:
185:
186:
187:
188:
189:
190:
191:
192:
193:
194:
195:
196:
197:
198:
199:
200:
201:
202:
203:
204:
205:
206:
207:
208:
209:
210:
211:
212:
213:
214:
215:
216:
217:
218:
219:
220:
221:
222:
223:
224:
225:
226:
227:
228:
229:
230:
231:
232:
233:
234:
235:
236:
237:
238:
239:
240:
241:
242:
243:
244:
245:
246:
247:
248:
249:
250:
251:
252:
253:
254:
255:
256:
257:
258:
259:
260:
261:
262:
263:
264:
265:
266:
267:
268:
269:
270:
271:
272:
273:
274:
275:
Sub BC()
'
' BC Macro
'
 
'
    Range("A6:F770").Select
    With Selection
        .HorizontalAlignment = xlLeft
        .VerticalAlignment = xlTop
        .WrapText = True
        .Orientation = 0
        .AddIndent = False
        .ShrinkToFit = False
        .ReadingOrder = xlContext
        .MergeCells = False
    End With
    With Selection.Font
        .Name = "Arial"
        .FontStyle = "Regular"
        .Size = 9
        .Strikethrough = False
        .Superscript = False
        .Subscript = False
        .OutlineFont = False
        .Shadow = False
        .Underline = xlUnderlineStyleNone
        .ThemeColor = xlThemeColorLight1
        .TintAndShade = 0
        .ThemeFont = xlThemeFontNone
    End With
    ActiveWindow.ScrollRow = 752
    ActiveWindow.ScrollRow = 750
    ActiveWindow.ScrollRow = 747
    ActiveWindow.ScrollRow = 742
    ActiveWindow.ScrollRow = 737
    ActiveWindow.ScrollRow = 735
    ActiveWindow.ScrollRow = 725
    ActiveWindow.ScrollRow = 720
    ActiveWindow.ScrollRow = 706
    ActiveWindow.ScrollRow = 693
    ActiveWindow.ScrollRow = 676
    ActiveWindow.ScrollRow = 659
    ActiveWindow.ScrollRow = 637
    ActiveWindow.ScrollRow = 623
    ActiveWindow.ScrollRow = 603
    ActiveWindow.ScrollRow = 591
    ActiveWindow.ScrollRow = 579
    ActiveWindow.ScrollRow = 559
    ActiveWindow.ScrollRow = 542
    ActiveWindow.ScrollRow = 518
    ActiveWindow.ScrollRow = 506
    ActiveWindow.ScrollRow = 484
    ActiveWindow.ScrollRow = 469
    ActiveWindow.ScrollRow = 447
    ActiveWindow.ScrollRow = 433
    ActiveWindow.ScrollRow = 411
    ActiveWindow.ScrollRow = 394
    ActiveWindow.ScrollRow = 374
    ActiveWindow.ScrollRow = 357
    ActiveWindow.ScrollRow = 335
    ActiveWindow.ScrollRow = 323
    ActiveWindow.ScrollRow = 303
    ActiveWindow.ScrollRow = 291
    ActiveWindow.ScrollRow = 272
    ActiveWindow.ScrollRow = 262
    ActiveWindow.ScrollRow = 252
    ActiveWindow.ScrollRow = 240
    ActiveWindow.ScrollRow = 225
    ActiveWindow.ScrollRow = 211
    ActiveWindow.ScrollRow = 199
    ActiveWindow.ScrollRow = 184
    ActiveWindow.ScrollRow = 174
    ActiveWindow.ScrollRow = 157
    ActiveWindow.ScrollRow = 147
    ActiveWindow.ScrollRow = 130
    ActiveWindow.ScrollRow = 121
    ActiveWindow.ScrollRow = 106
    ActiveWindow.ScrollRow = 99
    ActiveWindow.ScrollRow = 86
    ActiveWindow.ScrollRow = 82
    ActiveWindow.ScrollRow = 72
    ActiveWindow.ScrollRow = 65
    ActiveWindow.ScrollRow = 60
    ActiveWindow.ScrollRow = 50
    ActiveWindow.ScrollRow = 47
    ActiveWindow.ScrollRow = 40
    ActiveWindow.ScrollRow = 35
    ActiveWindow.ScrollRow = 28
    ActiveWindow.ScrollRow = 21
    ActiveWindow.ScrollRow = 16
    ActiveWindow.ScrollRow = 13
    ActiveWindow.ScrollRow = 6
    Range("F6:G770").Select
    Selection.NumberFormat = "[$-409]d-mmm;@"
    With Selection
        .HorizontalAlignment = xlRight
        .VerticalAlignment = xlTop
        .WrapText = True
        .Orientation = 0
        .AddIndent = False
        .ShrinkToFit = False
        .ReadingOrder = xlContext
        .MergeCells = False
    End With
    With Selection.Font
        .Name = "Arial"
        .FontStyle = "Regular"
        .Size = 9
        .Strikethrough = False
        .Superscript = False
        .Subscript = False
        .OutlineFont = False
        .Shadow = False
        .Underline = xlUnderlineStyleNone
        .ThemeColor = xlThemeColorLight1
        .TintAndShade = 0
        .ThemeFont = xlThemeFontNone
    End With
    ActiveWindow.ScrollRow = 752
    ActiveWindow.ScrollRow = 747
    ActiveWindow.ScrollRow = 742
    ActiveWindow.ScrollRow = 737
    ActiveWindow.ScrollRow = 732
    ActiveWindow.ScrollRow = 720
    ActiveWindow.ScrollRow = 711
    ActiveWindow.ScrollRow = 701
    ActiveWindow.ScrollRow = 676
    ActiveWindow.ScrollRow = 654
    ActiveWindow.ScrollRow = 623
    ActiveWindow.ScrollRow = 596
    ActiveWindow.ScrollRow = 557
    ActiveWindow.ScrollRow = 530
    ActiveWindow.ScrollRow = 496
    ActiveWindow.ScrollRow = 472
    ActiveWindow.ScrollRow = 437
    ActiveWindow.ScrollRow = 418
    ActiveWindow.ScrollRow = 391
    ActiveWindow.ScrollRow = 372
    ActiveWindow.ScrollRow = 347
    ActiveWindow.ScrollRow = 328
    ActiveWindow.ScrollRow = 301
    ActiveWindow.ScrollRow = 281
    ActiveWindow.ScrollRow = 264
    ActiveWindow.ScrollRow = 235
    ActiveWindow.ScrollRow = 221
    ActiveWindow.ScrollRow = 191
    ActiveWindow.ScrollRow = 174
    ActiveWindow.ScrollRow = 145
    ActiveWindow.ScrollRow = 125
    ActiveWindow.ScrollRow = 99
    ActiveWindow.ScrollRow = 79
    ActiveWindow.ScrollRow = 55
    ActiveWindow.ScrollRow = 35
    ActiveWindow.ScrollRow = 8
    ActiveWindow.ScrollRow = 6
    Range("A5:G5").Select
    With Selection
        .HorizontalAlignment = xlCenter
        .VerticalAlignment = xlTop
        .WrapText = True
        .Orientation = 0
        .AddIndent = False
        .IndentLevel = 0
        .ShrinkToFit = False
        .ReadingOrder = xlContext
        .MergeCells = False
    End With
    With Selection.Font
        .Name = "Arial"
        .FontStyle = "Bold"
        .Size = 8
        .Strikethrough = False
        .Superscript = False
        .Subscript = False
        .OutlineFont = False
        .Shadow = False
        .Underline = xlUnderlineStyleNone
        .ThemeColor = xlThemeColorLight1
        .TintAndShade = 0
        .ThemeFont = xlThemeFontNone
    End With
    Range("H5:AT5").Select
    Selection.NumberFormat = "[$-409]d-mmm;@"
    With Selection
        .HorizontalAlignment = xlCenter
        .VerticalAlignment = xlBottom
        .WrapText = True
        .Orientation = 0
        .AddIndent = False
        .IndentLevel = 0
        .ShrinkToFit = False
        .ReadingOrder = xlContext
        .MergeCells = False
    End With
    With Selection.Font
        .Name = "Arial"
        .FontStyle = "Regular"
        .Size = 9
        .Strikethrough = False
        .Superscript = False
        .Subscript = False
        .OutlineFont = False
        .Shadow = False
        .Underline = xlUnderlineStyleNone
        .ColorIndex = xlAutomatic
        .TintAndShade = 0
        .ThemeFont = xlThemeFontNone
    End With
    ActiveWindow.ScrollColumn = 41
    ActiveWindow.ScrollColumn = 40
    ActiveWindow.ScrollColumn = 39
    ActiveWindow.ScrollColumn = 36
    ActiveWindow.ScrollColumn = 34
    ActiveWindow.ScrollColumn = 30
    ActiveWindow.ScrollColumn = 27
    ActiveWindow.ScrollColumn = 22
    ActiveWindow.ScrollColumn = 18
    ActiveWindow.ScrollColumn = 14
    ActiveWindow.ScrollColumn = 13
    ActiveWindow.ScrollColumn = 11
    ActiveWindow.ScrollColumn = 8
    Range("H6:AQ910").Select
    Selection.NumberFormat = "General"
    With Selection.Font
        .Name = "Arial"
        .FontStyle = "Regular"
        .Size = 9
        .Strikethrough = False
        .Superscript = False
        .Subscript = False
        .OutlineFont = False
        .Shadow = False
        .Underline = xlUnderlineStyleNone
        .ColorIndex = xlAutomatic
        .TintAndShade = 0
        .ThemeFont = xlThemeFontNone
    End With
    ActiveWindow.ScrollRow = 901
    ActiveWindow.ScrollRow = 898
    ActiveWindow.ScrollRow = 893
    ActiveWindow.ScrollRow = 886
    ActiveWindow.ScrollRow = 879
    ActiveWindow.ScrollRow = 869
    ActiveWindow.ScrollRow = 859
    ActiveWindow.ScrollRow = 849
    ActiveWindow.ScrollRow = 830
    ActiveWindow.ScrollRow = 818
    ActiveWindow.ScrollRow = 789
    ActiveWindow.ScrollRow = 769
    ActiveWindow.ScrollRow = 728
    ActiveWindow.ScrollRow = 701
    ActiveWindow.ScrollRow = 667
    ActiveWindow.ScrollRow = 637
    ActiveWindow.ScrollRow = 596
    ActiveWindow.ScrollRow = 567
    ActiveWindow.ScrollRow = 520
    ActiveWindow.ScrollRow = 491
    ActiveWindow.ScrollRow = 435
    ActiveWindow.ScrollRow = 406
    ActiveWindow.ScrollRow = 357
    ActiveWindow.ScrollRow = 328
    ActiveWindow.ScrollRow = 279
    ActiveWindow.ScrollRow = 250
    ActiveWindow.ScrollRow = 223
    ActiveWindow.ScrollRow = 189
    ActiveWindow.ScrollRow = 162
    ActiveWindow.ScrollRow = 130
    ActiveWindow.ScrollRow = 111
    ActiveWindow.ScrollRow = 82
    ActiveWindow.ScrollRow = 65
    ActiveWindow.ScrollRow = 43
    ActiveWindow.ScrollRow = 26
    ActiveWindow.ScrollRow = 6
End Sub
Open in New Window Select All

Answer : Macro freezes Excel.  Desperate!

Thanks Mato01  -  I am glad that your macro is running.  I suspected there was a conflict within the routines which is why I asked you to upload the file.
Random Solutions  
 
programming4us programming4us