Hello Everyone,
I am looking for a simple code.
What i want to do that i have 2 sheets in a excel file. Input sheet contains 100 people result data & Output sheet is Individual person result sheet. So the idea is when i run the macro, in the second sheet it put 1 people information details with details result, then convert it into PDF file & automatically save the PDF file to desktop.
The code working perfectly but what i want that, there will be Folder Selection dialog box at the begining for the process by which i will select the folder where all the PDF files will be stored after conversion. Below is my code :
Sub ALL_PDF()
Dim lastrow As Long, RA As Long
lastrow = Sheets("Trainee_Database").Cells(Rows.Count, "A").End(xlUp).Row
For RA = lastrow To 2 Step -1
Sheets("Trainee_Database").Select
Range("A" & RA).Select
Selection.Copy
Sheets("10072F").Select
Range("C10").PasteSpecial Paste:=xlPasteValues
Sheet1.Range("A1:J58").ExportAsFixedFormat xlTypePDF, Filename:="C:\Users\Asus\Desktop\PDF\10072F\" & Sheet1.Range("C10").Value, openafterpublish:=False
Next RA
End Sub
I am looking for a simple code.
What i want to do that i have 2 sheets in a excel file. Input sheet contains 100 people result data & Output sheet is Individual person result sheet. So the idea is when i run the macro, in the second sheet it put 1 people information details with details result, then convert it into PDF file & automatically save the PDF file to desktop.
The code working perfectly but what i want that, there will be Folder Selection dialog box at the begining for the process by which i will select the folder where all the PDF files will be stored after conversion. Below is my code :
Sub ALL_PDF()
Dim lastrow As Long, RA As Long
lastrow = Sheets("Trainee_Database").Cells(Rows.Count, "A").End(xlUp).Row
For RA = lastrow To 2 Step -1
Sheets("Trainee_Database").Select
Range("A" & RA).Select
Selection.Copy
Sheets("10072F").Select
Range("C10").PasteSpecial Paste:=xlPasteValues
Sheet1.Range("A1:J58").ExportAsFixedFormat xlTypePDF, Filename:="C:\Users\Asus\Desktop\PDF\10072F\" & Sheet1.Range("C10").Value, openafterpublish:=False
Next RA
End Sub