View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
GB GB is offline
external usenet poster
 
Posts: 230
Default set up toggle button to set print area

Yes it's possible... I'm not entirely sure what the VBA code would be. I
would recommend two buttons or at least sufficient information so that the
user knows which range is being printed.

Easiest way I think for you to develop the option is to record a macro that
has you set the print area to area 1. Then record one to set the print area
to area 2. Create a button that tells the user (either by changing the
caption of the button or the information in some cell or some other option)
which selection is current, and how to switch to the other range. That
button would/could check to see which print area was currently selected, if
it is one, then select two. If it is two then select one. If it is neither
then you should determine what should be done. (i.e., force range one, force
range two, and/or prompt user.)

The reason for a second button would be to have it print just say a
selection, vice printing the Print area. But totally up to you on
implementation.


"John Davies" wrote:

At times I need to print a different section of a spreadsheet.
Is it possible to set up a toggle button to set the area for printing?
For example to print cells a1:a6 you would click on the button once but to
print cells a1:a20 you would click on it again.

Thanks in advance of a favourable reply.

Regards
John D