sir i have a excel file here in drop box for that i have got vba code but i want to add a line after each array
so that i can recognize the deffrence between them
the file is in drop box
https://www.dropbox.com/s/1n1c8k6uck...important.xlsm
and VBA codes are
Sub AutoFilter_Array_01()
On Error Resume Next
Dim v As Variant
v = Array("1a", "1b", "2a", "2b", "3a", "3b", "4a", "4b", "5a", "5b", "6a", "6b", _
"7a", "7b", "8a", "8b", "9a", "9b", "10a", "10b", "11a", "11b", "12a", "12b")
Dim ws1 As Worksheet, ws2 As Worksheet
Set ws1 = Sheets("Data") '<<<< Source sheet
Set ws2 = Sheets("paste") '<<<< Target sheet
ws1.AutoFilterMode = False
Dim L1 As Long, L2 As Long
L1 = ws1.Cells(Rows.Count, "A").End(xlUp).Row
L2 = 2
Application.ScreenUpdating = False
ws2.Cells.ClearContents '<<< delete previous data from Target Sheet
ws1.Rows(1).Copy
ws2.Range("A1").PasteSpecial xlPasteValues
Application.CutCopyMode = False
For x = 0 To UBound(v)
ws1.Range("D1:D" & L1).AutoFilter Field:=1, Criteria1:=v(x)
ws1.Rows(2 & ":" & L1).SpecialCells(xlCellTypeVisible).Copy
ws2.Cells(L2, 1).PasteSpecial xlPasteValues
Application.CutCopyMode = False
ws1.AutoFilterMode = False
L2 = ws2.UsedRange.Rows.Count + 1
Next
ws1.AutoFilterMode = False
ws2.UsedRange.EntireColumn.AutoFit
Application.ScreenUpdating = True
On Error GoTo 0
End Sub
thank you in advance
harish
Bookmarks