Building an array of worksheets for printing
I have one array that I use for printing a subset of worksheets in a
workbook. Baseline array is defined as:
Sheets(Array("Cover", "AboutThisIllustration", "PolicyValuesLedger", _
"PolicyValuesLedgerGuar", _
"PolicyValuesLedgerNonGuar")).Select
Depending on various Booleans I need to add other worksheets to the above.
Inclusion of these other worksheets is dependent on Booleans.
So if BoolBSIB is TRUE, then I need to add "PolicyValuesLedgerGuarGSIB", to
the above array BEFORE I get to the "PolicyValuesLedgerGuar", _
So it should read
Sheets(Array("Cover", "AboutThisIllustration", "PolicyValuesLedger", _
"PolicyValuesLedgerGuarGSIB", _
"PolicyValuesLedgerGuar", _
"PolicyValuesLedgerNonGuar")).Select
I'm stymied on how to build up this array inside of VBA. There are three
other worksheets that may or may not get printed. How can i do this inside of
VBA?
I'd hate to brute force it by building each potential variation but...I'd
prefer a more elegant solution.
--
DRK
|