Output File name based on Slicer Settings

bobhasnoidea

New Member
Joined
Apr 9, 2019
Messages
8
Hi there, I'm a complete VBA novice, but have sorted out a macro that selects three different worksheets and creates a PDF of those three sheets and the Pivotcharts within them.

Sub Scheme_YEAR()
Dim myPath As String
Dim FolderPath As String
FolderPath = Application.ActiveWorkbook.Path
myPath = Application.ActiveWorkbook.FullName
On Error Resume Next
MkDir FolderName
On Error GoTo 0
Sheets(Array("Scheme Specific by Root Cause", "Scheme Specific Annual Root")).Select
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=FolderPath & "\Close Call - Scheme Specific Year to Date", _
openafterpublish:=False, ignoreprintareas:=False
MsgBox "Report successfully created."
Sheets("Step 2 - Data Entry and Reports").Select
End Sub


So far so good.
What I would like, is for the output file name to be a concatenate of the two active slicers so I can select the options I want on my slicers and then run my Macro to create the PDF and now what the PDF actual contains.

Is this achievable?
Can anyone provide any pointers?
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().

Forum statistics

Threads
1,223,909
Messages
6,175,312
Members
452,634
Latest member
cpostell

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