Hi,
I've been searching for code to fit what I'm doing, but I can't find it. I've found a lot of stuff that's close, but I haven't figured out how to adapt it so I'm hoping someone can kindly assist me.
What I'm trying to do:
Export sheets from a workbook as PDF based on checkboxes that are selected
Problem:
Using if statements and concatenate I can create the array that I need in a cell (see images). So excel D203 contains the array, but I can't figure out how to feed it in to the Sheets(Array(4, 5, 6, 7)).Select code to replace the 4,5,6,7. I basically need it to say Sheets(Array(whatever array is in cell D203)).Select.
Here is the code that I have
I've been searching for code to fit what I'm doing, but I can't find it. I've found a lot of stuff that's close, but I haven't figured out how to adapt it so I'm hoping someone can kindly assist me.
What I'm trying to do:
Export sheets from a workbook as PDF based on checkboxes that are selected
Problem:
Using if statements and concatenate I can create the array that I need in a cell (see images). So excel D203 contains the array, but I can't figure out how to feed it in to the Sheets(Array(4, 5, 6, 7)).Select code to replace the 4,5,6,7. I basically need it to say Sheets(Array(whatever array is in cell D203)).Select.
Here is the code that I have
VBA Code:
Sub Button4_Click()
Dim v As Variant
v = Application.GetSaveAsFilename("Generic Filename.pdf", "PDF Files (*.pdf), *.pdf")
If VarType(v) = vbString Then
Sheets(Array(4, 5, 6, 7)).Select
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=v, _
Quality:=xlQualityStandard, IncludeDocProperties:=True, _
IgnorePrintAreas:=False, OpenAfterPublish:=True
End If
End Sub