Option Explicit
Sub Tops()
Dim a, LR&
With Sheets("Tops")
a = Array(.Range("E18"), .Range("E17"), .Range("E21"), .Range("AQ28"), .Range("E14"), _
.Range("AQ29"), .Range("AQ30"))
With Sheets("CTop List")
LR = .Cells.Find("*", , , , xlByRows, xlPrevious).Row + 1
.Range("A" & LR).Resize(, UBound(a) + 1) = a
With .UsedRange
.Value = .Value
.Columns.AutoFit
End With
End With
Call Test1
Call Test2
Call Test3
.Range("E18,E21").ClearContents
End With
End Sub
Sub Test1()
Application.ScreenUpdating = 0
Dim result, n&, i&, ar As Variant, j&
With Sheets("Tops")
ar = .Range("G12:P" & .Cells.Find("*", , , , xlByRows, xlPrevious).Row)
End With
ReDim result(1 To UBound(ar), 1 To UBound(ar, 2))
For i = 1 To UBound(ar, 1)
If ar(i, 3) > 0 And ar(i, 3) <> "Copies" Then
n = n + 1
For j = 1 To UBound(ar, 2)
result(n, j) = ar(i, j)
Next
End If
Next i
With Worksheets("Wood Parts")
If n > 0 Then .Range("A" & .Rows.Count).End(xlUp).Offset(1).Resize(n, UBound(ar, 2)) = result
End With
Application.ScreenUpdating = True
End Sub
Sub Test2()
Application.ScreenUpdating = 0
Dim result, n&, i&, ar As Variant, j&
With Sheets("Tops")
ar = .Range("R12:AA" & .Cells.Find("*", , , , xlByRows, xlPrevious).Row)
End With
ReDim result(1 To UBound(ar), 1 To UBound(ar, 2))
For i = 1 To UBound(ar, 1)
If ar(i, 3) > 0 And ar(i, 3) <> "Copies" Then
n = n + 1
For j = 1 To UBound(ar, 2)
result(n, j) = ar(i, j)
Next
End If
Next i
With Worksheets("Plam Parts")
If n > 0 Then .Range("A" & .Rows.Count).End(xlUp).Offset(1).Resize(n, UBound(ar, 2)) = result
End With
Application.ScreenUpdating = True
End Sub
Sub Test3()
Application.ScreenUpdating = 0
Dim result, n&, i&, ar As Variant, j&
With Sheets("Tops")
ar = .Range("AN12:AU" & .Cells.Find("*", , , , xlByRows, xlPrevious).Row)
End With
ReDim result(1 To UBound(ar), 1 To UBound(ar, 2))
For i = 1 To UBound(ar, 1)
If ar(i, 1) > 0 And ar(i, 3) <> "Ctop#" Then
n = n + 1
For j = 1 To UBound(ar, 2)
result(n, j) = ar(i, j)
Next
End If
Next i
With Worksheets("Shop")
If n > 0 Then .Range("A" & .Rows.Count).End(xlUp).Offset(1).Resize(n, UBound(ar, 2)) = result
End With
Application.ScreenUpdating = True
End Sub
Bookmarks