Try this:
Option Explicit
Sub ShortLongBaskets()
Dim RNG As Range, rFind As Range
Dim LastRw As Long, Rw As Long
Application.ScreenUpdating = False
LastRw = Range("B" & Rows.Count).End(xlUp).Row
For Rw = 66 To LastRw Step 21
Select Case LCase(Range("B" & Rw).Text)
Case "short"
Range("B" & Rw + 1).Resize(20, 1).Value = "Long Basket"
Case "long"
Range("B" & Rw + 1).Resize(20, 1) = "Short Basket"
End Select
Range(Range("F" & Rw + 1), Range("F" & Rw + 20)).FormulaR1C1 = _
"=IF(INDEX(R7C27:R26C40, ROW(R[-" & Rw & "]C1), MATCH(R" & Rw & "C6, R6C27:R6C40, 0))=0,"""",INDEX(R7C27:R26C40, ROW(R[-" & Rw & "]C1), MATCH(R" & Rw & "C6, R6C27:R6C40, 0)))"
Next Rw
With Range("F:F")
.Value = .Value
.SpecialCells(xlCellTypeConstants, 16).Clear
End With
Application.ScreenUpdating = True
End Sub
Bookmarks