Hi Guys,
I'm new to vba and macros and I'm trying to cut certain rows in the for loop and the find a specific value / cell and paste the cut rows below that cell in the same sheet. All this happens with the for loop as the list is dynamic.
'----------16----------select all purple rows
Range("A1").AutoFilter Field:=5, Criteria1:=RGB(204, 192, 218), Operator:=xlFilterCellColor
LR = Range("A" & Rows.Count).End(xlUp).Row
Range("E2:E" & LR).SpecialCells(xlCellTypeVisible).Select
'----------Insert selection contents in an array
Dim arMyArray() As Variant
arMyArray = Selection.Value
'--------------
Range("A1").AutoFilter
For Each elem In arMyArray
a = Right(elem, 12)
Range("A1").AutoFilter Field:=1, Criteria1:=a
Range("A2:F" & LR).SpecialCells(xlCellTypeVisible).Select
Selection.Cut
Range("A1").AutoFilter
Range("A2:F" & LR).Find(What:=elem).Select
Selection.Offset(1).Insert Shift:=xlDown
---- Not sure How I could paste the cut rows below the selected cell.
Thanks for the help!