Dear Team,
Need your help please.
I have a file with associates and their respective project details. Column E has the project ID details.
The manual activity that I does is, I filter a project ID and then copy all the details related to that project to a new excel file and then save it as PDF file in a desktop folder. Repeat the same for next project ID. So if there are 10 Project IDs in the file, I create 10 PDF Files.
Need help with a macro code to automate this. Sample file attached.
There is another similar activity that I does for which I already have the code. However in this activity after filtering the project ID in a column, the details are saved as an Excel file and not PDF.
Below is the code for that for reference.
Sub AAA()
Dim e
Application.ScreenUpdating = False
With Sheets("AAA").Cells(1).CurrentRegion
.Parent.AutoFilterMode = False
For Each e In Filter(.Parent.[transpose(if(countif(offset(e2:e10000,,,row(1:10000)),e2:e1000)=1,e2:e1000,char(2)))], Chr(2), 0)
.AutoFilter 5, e
.Copy Sheets("sheet2").Cells(1)
Sheets("sheet2").Copy
Worksheets("Sheet2").Columns("A:BX").AutoFit
Worksheets("Sheet2").Rows("1:10000").AutoFit
ActiveWorkbook.SaveAs "C:\Users\\Downloads\ Course" & "\" & "" & e & ".xlsx"
ActiveWorkbook.Close
.AutoFilter: Sheets("sheet2").Cells.Clear
Next
End With
Application.ScreenUpdating = False
End Sub
Bookmarks