Im really new to macros and trying to learn by looking at examples but have hit a road block here.
The excel file I am working on has 3 tabs/sheets. Sorted Data, Quarterly Data, and Data Validation.
The sorted data has a Unit Number drop down list(Data Validation list) from the DV sheet. The selection can and will change quarterly.
The list is reference is
because the list may grow or shrink each quarter (Company is a selectable option so it gives a total for all unit numbers)
I have a button next to the unit selection that will export to PDF and name the PDF based on the unit number selected.
I am trying to get the button to cycle through all the options in the list (Data Validation list) and export each one to PDF.
The cell for the drop down list is a merged cell on C6/D6
This is the PDF export button code I currently have
Anyone able to help me out here?
Thank you in advance!
The excel file I am working on has 3 tabs/sheets. Sorted Data, Quarterly Data, and Data Validation.
The sorted data has a Unit Number drop down list(Data Validation list) from the DV sheet. The selection can and will change quarterly.
The list is reference is
Excel Formula:
='Data Validation'!$A:$A
I have a button next to the unit selection that will export to PDF and name the PDF based on the unit number selected.
I am trying to get the button to cycle through all the options in the list (Data Validation list) and export each one to PDF.
The cell for the drop down list is a merged cell on C6/D6
This is the PDF export button code I currently have
VBA Code:
Sub CreatePDF()
Dim ID As String
ID = Range("C6").Text
ActiveSheet.ExportAsFixedFormat _
Type:=xlTypePDF, _
FileName:="C:\Documents\" + ID + ".pdf", _
IgnorePrintAreas:=False, _
OpenAfterPublish:=False
End Sub
Anyone able to help me out here?
Thank you in advance!