VBA Save Templates As PDF

lord of horses

New Member
Joined
Jun 18, 2015
Messages
6
I have two sheets (Sheet1, & Sheet2).

Sheet2 is a template that has multiple vlookups connected to Sheet1.

What I would like to do, is go through every single row (A2, A3, etc) from Sheet1 & paste it into Sheet2 Cell C5, and Save As the text from A2 in Sheet1.

Not having much luck, and was hoping someone could help.

Sub Macro1()

RowCount = Worksheets("Sheet1").Cells(Rows.Count, 1).End(xlUp).Row - 1

Worksheets("Sheet2").Select
For i = 1 To RowCount
Range("C5").Value = i
ChDir "C:\New folder"
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
"C:\New folder" & Range("C5").pdf", Quality:= _
xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, _
OpenAfterPublish:=True
Next i

End Sub

Thanks in advance!
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.

Forum statistics

Threads
1,221,310
Messages
6,159,176
Members
451,543
Latest member
cesymcox

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