[FONT=lucida console][color=Royalblue]Sub[/color] a1092546a()
[i][color=seagreen]'https://www.mrexcel.com/forum/excel-questions/1092546-combine-multiple-50-more-workbooks-vba.html[/color][/i]
[color=Royalblue]Dim[/color] ws [color=Royalblue]As[/color] Worksheet, t
[color=Royalblue]Dim[/color] z1 [color=Royalblue]As[/color] [color=Royalblue]Double[/color], x1 [color=Royalblue]As[/color] [color=Royalblue]Double[/color]
[color=Royalblue]Dim[/color] z2 [color=Royalblue]As[/color] [color=Royalblue]Double[/color], x2 [color=Royalblue]As[/color] [color=Royalblue]Double[/color]
[color=Royalblue]Dim[/color] z3 [color=Royalblue]As[/color] [color=Royalblue]Double[/color], x3 [color=Royalblue]As[/color] [color=Royalblue]Double[/color]
[color=Royalblue]Dim[/color] z4 [color=Royalblue]As[/color] [color=Royalblue]Double[/color], x4 [color=Royalblue]As[/color] [color=Royalblue]Double[/color]
[color=Royalblue]Dim[/color] z5 [color=Royalblue]As[/color] [color=Royalblue]Double[/color], x5 [color=Royalblue]As[/color] [color=Royalblue]Double[/color]
[color=Royalblue]Dim[/color] z6 [color=Royalblue]As[/color] [color=Royalblue]Double[/color], x6 [color=Royalblue]As[/color] [color=Royalblue]Double[/color]
[color=Royalblue]Dim[/color] z7 [color=Royalblue]As[/color] [color=Royalblue]Double[/color], x7 [color=Royalblue]As[/color] [color=Royalblue]Double[/color]
[color=Royalblue]Dim[/color] z8 [color=Royalblue]As[/color] [color=Royalblue]Double[/color], x8 [color=Royalblue]As[/color] [color=Royalblue]Double[/color]
t = Timer
[color=Royalblue]For[/color] [color=Royalblue]Each[/color] ws [color=Royalblue]In[/color] Worksheets
[color=Royalblue]If[/color] UCase(ws.Name) <> UCase([color=brown]"TEMP"[/color]) [color=Royalblue]Then[/color]
[color=Royalblue]With[/color] ws
[color=Royalblue]If[/color] Len(z1) = [color=crimson]0[/color] [color=Royalblue]Then[/color] z1 = WorksheetFunction.Max(.Range([color=brown]"H16:H23"[/color]))
[color=Royalblue]If[/color] Len(z2) = [color=crimson]0[/color] [color=Royalblue]Then[/color] z2 = WorksheetFunction.Max(.Range([color=brown]"H27:H34"[/color]))
[color=Royalblue]If[/color] Len(z3) = [color=crimson]0[/color] [color=Royalblue]Then[/color] z3 = WorksheetFunction.Max(.Range([color=brown]"L75:L80"[/color]))
[color=Royalblue]If[/color] Len(z4) = [color=crimson]0[/color] [color=Royalblue]Then[/color] z4 = WorksheetFunction.Min(.Range([color=brown]"L75:L80"[/color]))
[color=Royalblue]If[/color] Len(z5) = [color=crimson]0[/color] [color=Royalblue]Then[/color] z5 = WorksheetFunction.Max(.Range([color=brown]"L87:L91"[/color]))
[color=Royalblue]If[/color] Len(z6) = [color=crimson]0[/color] [color=Royalblue]Then[/color] z6 = WorksheetFunction.Min(.Range([color=brown]"L87:L91"[/color]))
[color=Royalblue]If[/color] Len(z7) = [color=crimson]0[/color] [color=Royalblue]Then[/color] z7 = .Range([color=brown]"H95"[/color])
[color=Royalblue]If[/color] Len(z8) = [color=crimson]0[/color] [color=Royalblue]Then[/color] z8 = .Range([color=brown]"H99"[/color])
x1 = WorksheetFunction.Max(.Range([color=brown]"H16:H23"[/color])): [color=Royalblue]If[/color] x1 > z1 [color=Royalblue]Then[/color] z1 = x1
x2 = WorksheetFunction.Max(.Range([color=brown]"H27:H34"[/color])): [color=Royalblue]If[/color] x2 > z2 [color=Royalblue]Then[/color] z2 = x2
x3 = WorksheetFunction.Max(.Range([color=brown]"L75:L80"[/color])): [color=Royalblue]If[/color] x3 > z3 [color=Royalblue]Then[/color] z3 = x3
x4 = WorksheetFunction.Min(.Range([color=brown]"L75:L80"[/color])): [color=Royalblue]If[/color] x4 < z4 [color=Royalblue]Then[/color] z4 = x4 [i][color=seagreen]'Min[/color][/i]
x5 = WorksheetFunction.Max(.Range([color=brown]"L87:L91"[/color])): [color=Royalblue]If[/color] x5 > z5 [color=Royalblue]Then[/color] z5 = x5
x6 = WorksheetFunction.Min(.Range([color=brown]"L87:L91"[/color])): [color=Royalblue]If[/color] x6 < z6 [color=Royalblue]Then[/color] z6 = x6 [i][color=seagreen]'Min[/color][/i]
x7 = .Range([color=brown]"H95"[/color]): [color=Royalblue]If[/color] x7 > z7 [color=Royalblue]Then[/color] z7 = x7
x8 = .Range([color=brown]"H99"[/color]): [color=Royalblue]If[/color] x8 > z8 [color=Royalblue]Then[/color] z8 = x8
[color=Royalblue]End[/color] [color=Royalblue]With[/color]
[color=Royalblue]End[/color] [color=Royalblue]If[/color]
[color=Royalblue]Next[/color]
[color=Royalblue]With[/color] Sheets([color=brown]"TEMP"[/color])
.Range([color=brown]"A1"[/color]) = [color=brown]"(DIM 1 DIA)"[/color]
.Range([color=brown]"B1"[/color]) = [color=brown]"(DIM 1 POS)"[/color]
.Range([color=brown]"C1"[/color]) = [color=brown]"(DIM 5 MIN)"[/color]
.Range([color=brown]"D1"[/color]) = [color=brown]"(DIM 5 MAX)"[/color]
.Range([color=brown]"E1"[/color]) = [color=brown]"(DIM 6 MIN)"[/color]
.Range([color=brown]"F1"[/color]) = [color=brown]"(DIM 6 MAX)"[/color]
.Range([color=brown]"G1"[/color]) = [color=brown]"(DIM 8 DIA)"[/color]
.Range([color=brown]"H1"[/color]) = [color=brown]"(DIM 8 POS)"[/color]
.Range([color=brown]"A2"[/color]) = z1
.Range([color=brown]"B2"[/color]) = z2
.Range([color=brown]"C2"[/color]) = z3
.Range([color=brown]"D2"[/color]) = z4
.Range([color=brown]"E2"[/color]) = z5
.Range([color=brown]"F2"[/color]) = z6
.Range([color=brown]"G2"[/color]) = z7
.Range([color=brown]"H2"[/color]) = z8
[color=Royalblue]End[/color] [color=Royalblue]With[/color]
MsgBox [color=brown]"It's done in "[/color] & Timer - t & [color=brown]" seconds"[/color]
[color=Royalblue]End[/color] [color=Royalblue]Sub[/color][/FONT]