Hi swtrader,
I understand your frustration. You were very close to solving the problem. The secret is the understanding of the difference between variables and objects. Until the difference is understood, there will probably be a lot of head scratching and bad words.
The Page Setup Print Area expects the address as a String, that is why you would need the .Address if you used a Range object (MyPrntRng.Address).
Another possible solution, is to declare the Print Range to contain all your data, and to Hide the Columns that you don't want printed.
I will answer attempt to your question with the following 4 examples:
The first example is a corrected copy of your original code, with the changes in red.
The second example only needs one input, the entire Print Range
The Third Example is similar to the first example, but restricts date selection o Dates in Column 'A'. Then it is assumed the print area extends to Column 'G' and creates a 'Final Print Area'.
Finally, a simple example of how columns could be hidden:
I hope this helps.
Lewis
Bookmarks