The code below in VBA applies filter to a certain table, select the visible cells after the filter and then paste the content in another tab called "CICLICO". The problem is... I want only the first three items AFTER applying the filter. Any ideas?
Sub Select_TheFirstThreeItemsAfterFilter()
'
Range("P8").Select
ActiveSheet.ListObjects("Tabela1").Range.AutoFilter Field:=10, Criteria1:= _
"MONTAGEM A"
ActiveSheet.ListObjects("Tabela1").Range.AutoFilter Field:=7, Criteria1:= _
"A"
ActiveSheet.ListObjects("Tabela1").Range.AutoFilter Field:=4, Criteria1:= _
Array("100", "110", "1159", "118", "119", "120", "135", "139", "14", "144", "152", "16", _
"161", "163", "171", "19", "209", "21", "212", "240", "25", "251", "280", "285", "3", "31", _
"32", "34", "36", "381", "39", "390", "5", "51", "54", "63", "67", "70", "74", "8", "84", "94" _
, "97"), Operator:=xlFilterValues
ActiveSheet.ListObjects("Tabela1").Range.AutoFilter Field:=14, Criteria1:= _
"="
Range("B11:H400").Select 'here is the part I want to select only the First Three Items After the filter
Selection.SpecialCells(xlCellTypeVisible).Select
Selection.Copy
Sheets("CICLICO").Select 'this select another tab and paste the information after the filter
Range("B8").Select
ActiveSheet.Paste
End Sub
I know I have to use the "Selection.SpecialCells(xlCellTypeVisible).Select" But I don't know how the select the first three items considering the number of the rows always change... But I don't know how to select the first three rows after applying the filter.
For example: Sometimes I want to select the rows 233, 500, 800 and another times 900, 1200 and 1800.