Array question

  • Thread starter Thread starter Stuart
  • Start date Start date
S

Stuart

PrintFileNames = Application.GetOpenFilename _
(FileFilter:="Excel Files (*.xls), *.xls", _
MultiSelect:=True)
gives me the workbooks selected by the user.

What I would ideally like to do is as follows:

Call each workbook and ask the following questions
of the user:

With Workbook "whatever".Name do you want to do
any of the following, to all of the worksheets:
i) print all worksheets
ii) print all ranges that total zero
iii) hide some columns

I think this used to be known as a 'conditional branching'
situation.

If i) ii) and iii) prove true for a particular workbook then
life is reasonably simple ( I think). But how do I best
structure code for the various options?

Is this a case for building arrays that are a sort of 'subset'
of the workbook array (is that possible?) for each of the
questions, since when any question returns False, then
I'm going to have to test each worksheet in each workbook.

The end result will be printed data for the user. Currently
there are only 3 types of workbook (a simple test establishes
which type) so pagesetup needs only to be established once
for each workbook, before the individual ranges are printed.

How do I structure this so that a user has the flexibility they
need, but such that they do not have to define every option
for each individual book/sheet, please?

With a lot of ng help, I have a routine that is 95% complete
in a rudimentary way, but being lengthy, I hesitate to post it
to the group.

Any advice would be most welcome.

Regards.
 
Back
Top