Hello,
I am pretty new to VBA and I am trying to learn how to work with it every since I am facing an issue on excel that can be automated (by mainly searching here some threads and managed to work my way until now).
Unfortunately, I have not found any similar solution to the issue I am facing now.
I have a dashboard on excel that is dynamic with values updating based on a list of cells (with checkbox). So on column "A" I have checkboxes and on Column "B" the name of the store (see print screen).
For example if I want the data to appear on the dashboard for the store "Ares", I click on the checkbox to the left on that store (which returns TRUE) and the dashboard gathers the data for that store from the other tabs.
What I want to do is to write a code which will select each store one by one and export the tab in PDF with the name of the store on a specific folder (example Ares.pdf). Here is the code that I have written but it is exporting the my own code in pdf. I am a beginner and I do not know how to resolve the issue.
Can you please help me ?
Thank you,
I am pretty new to VBA and I am trying to learn how to work with it every since I am facing an issue on excel that can be automated (by mainly searching here some threads and managed to work my way until now).
Unfortunately, I have not found any similar solution to the issue I am facing now.
I have a dashboard on excel that is dynamic with values updating based on a list of cells (with checkbox). So on column "A" I have checkboxes and on Column "B" the name of the store (see print screen).
For example if I want the data to appear on the dashboard for the store "Ares", I click on the checkbox to the left on that store (which returns TRUE) and the dashboard gathers the data for that store from the other tabs.
What I want to do is to write a code which will select each store one by one and export the tab in PDF with the name of the store on a specific folder (example Ares.pdf). Here is the code that I have written but it is exporting the my own code in pdf. I am a beginner and I do not know how to resolve the issue.
VBA Code:
Sub ExportPDF()
Dim NamePDF As Worksheet
Set NamePDF = ActiveWorkbook.Sheets(1)
For i = 27 To 87
Cells(i, 1).Value = "True"
SName = NamePDF.Cells(i, 2)
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
"\\Path" & SName, _
Quality:=xlQualityStandard, IncludeDocProperties:=True, _
IgnorePrintAreas:=False, OpenAfterPublish:=True
Cells(i, 1).Value = "False"
Next i
End Sub
Thank you,