Morshed_Dhaka
New Member
- Joined
- Dec 16, 2016
- Messages
- 42
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 PrintStaffForm()
For r = 14 To 350
Sheets("OUTPUT").Range("AX2").Value = Cells(r, 1).Value
Sheets("OUTPUT").ExportAsFixedFormat Type:=xlTypePDF, Filename:=Sheets("OUTPUT").Range("AX5").Value & ".pdf"
On Error Resume Next
Next r
End Sub
Will be really helpful if somebody help me to build the code which i am looking for.
Thanks
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 PrintStaffForm()
For r = 14 To 350
Sheets("OUTPUT").Range("AX2").Value = Cells(r, 1).Value
Sheets("OUTPUT").ExportAsFixedFormat Type:=xlTypePDF, Filename:=Sheets("OUTPUT").Range("AX5").Value & ".pdf"
On Error Resume Next
Next r
End Sub
Will be really helpful if somebody help me to build the code which i am looking for.
Thanks