VB loop through selected range, update cell then PDF

Viperuk

New Member
Joined
Mar 14, 2016
Messages
19
Hi all.

I have a training certificate generator and I want to select a range in the 'Records' sheet which has unique reference numbers in column A:A.

What I would like to do is enter the completed training details in the Records sheet.

Then select the range of completed training in column A

Then, for each unique reference number in the selected range, update cell F14 in the active sheet (selected manually) and PDF, looping through the range updating F14 and PDFing until the end of the range.

I have this sorted for a single certificate, but I now have hundreds to PDF and I am struggling.



Sub A_PDF_Certs()

Application.ScreenUpdating = False
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, _
Filename:=ThisWorkbook.Path & "\" & Range("Z1").Text & " " & Range("Z2").Text & " " & Range("Z3") & " " & "exp" & " " & Range("Z4").Text
OpenAfterPublish = False
Application.ScreenUpdating = True

End Sub


Z1 is just =F14 (the unique certificate number)
Z2 is the delegate name
Z3 is the course name shortened
Z4 is the date formatted to **.**.****


Any help would be appreciated.
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!

Forum statistics

Threads
1,214,636
Messages
6,120,668
Members
448,977
Latest member
moonlight6

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top