Hi Team,
I am using the below code to automatically filter the data and copy the filtered data to new excel.
I got this code from the same forum.
Sub test()
Dim e
Application.ScreenUpdating = False
With Sheets("sheet1").Cells(1).CurrentRegion
.Parent.AutoFilterMode = False
For Each e In Filter(.Parent.[transpose(if(countif(offset(a2:a10000,,,row(1:10000)),a2:a1000)=1,a2:a1000&char(3)&e2:e10000,char(2)))], Chr(2), 0)
.AutoFilter 1, Split(e, Chr(3))(0)
.Copy Sheets("sheet2").Cells(1)
Sheets("sheet2").Copy
ActiveWorkbook.SaveAs ThisWorkbook.Path & "\" & Split(e, Chr(3))(1) & ".xlsx"
ActiveWorkbook.Close
.AutoFilter: Sheets("sheet2").Cells.Clear
Next
End With
Application.ScreenUpdating = False
End Sub
The problem that I am facing now is my source data got changed in such a way that the filter has to be applied in row 3, column 4 instead of row 1.
I tried editing but I am getting errors. I request someone to help me. Sample data with the previous code attached. Column G,H,I are newly added in this sheet.
Please help
Bookmarks