It's probably some expert symposium ?
So, maybe also something with arrays to the collection ?
Sub cpypste_1()
With ThisWorkbook
With .Sheets("Main Data")
Dim x: x = InputBox("Enter Group Number (1 or 2): ", "Search Group ")
If Trim(x) = "" Then Exit Sub: If Not IsNumeric(x) Then Exit Sub
x = Abs(CInt(x))
Dim tbltmp(), tbl(), ubR&, ubC&, i&, j&, k&: k = 0
With .Range("a2").CurrentRegion
tbltmp = .Offset(2, 0).Resize(.Rows.Count - 2, .Columns.Count).Value
End With
End With
ubR = UBound(tbltmp, 1): ubC = UBound(tbltmp, 2)
For i = 1 To ubR
If tbltmp(i, 1) = x Then
k = k + 1: ReDim Preserve tbl(1 To 6, 1 To k)
For j = 2 To 6
tbl(j - 1, k) = tbltmp(i, j)
Next
tbl(6, k) = tbltmp(i, 12)
End If
Next
Erase tbltmp
With .Sheets("Group 2 Printout")
.Activate
.Range("a" & .Rows.Count).End(xlUp).Offset(1, 0).Resize(UBound(tbl, 2), UBound(tbl, 1)).Value = Application.Transpose(tbl)
Erase tbl
End With
End With
End Sub
Bookmarks