Excel PDF Macro

Excel Fox

New Member
Joined
Nov 18, 2020
Messages
9
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
Hi all

A bit new to VBA. I have a macro that will produce a PDF for a excel dashboard. It pulls all the data into the dashboard from a list.

The coding i have used that works is below. I know there is way to automate/loop this so that it will work through full list but Im struggling to get my head round the coding.

Any help greatly received.

Thanks
Fox

Sub CreatePDF()

Dim ID As String

ID = Range("J6").Text



ActiveSheet.ExportAsFixedFormat _

Type:=xlTypePDF, _

Filename:="\\persian2\staffmydocs$\FowkesCr\Documents\Test\" + ID + ".pdf", _

IgnorePrintAreas:=False, _

OpenAfterPublish:=False

End Sub



Sub Save_Excel_As_PDF_1()



ActiveSheet.ExportAsFixedFormat _

Type:=xlTypePDF



End Sub
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.

Forum statistics

Threads
1,215,741
Messages
6,126,588
Members
449,319
Latest member
iaincmac

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