#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 46
Default option buttons


-- I have a worksheet that shows a weeks roster for 2 locations. What I
would like to be able to do is to have 2 option buttons such that depending
on the selection the print area would be set and the appropriate locations
roster be printed.
OptionbuttonSW would set the print area as A$2:$H$9
OptionbuttonMW would set the print area as $A$11:$H$27

Al
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,939
Default option buttons

In XL add the Contol Toolbox to your list of toolbars. Drag 2 option buttons
onto your sheet. Right click on of the buttons and change the (Name) to optSW
and the Caption to SW. Select the other button and make the (Name) optMW with
a Caption of MW. Double click either of the option buttons. This takes you to
the VBE with a on click code stub for that button. Add the following...

Private Sub optMW_Click()
Me.PageSetup.PrintArea = "A11:H27"
End Sub

Private Sub optSW_Click()
Me.PageSetup.PrintArea = "A1:H9"
End Sub

Now go back to the worksheet and exit design mode by clicking on the Ruler
and Triangle icon on the Control Toolbox...
--
HTH...

Jim Thomlinson


"gramps" wrote:


-- I have a worksheet that shows a weeks roster for 2 locations. What I
would like to be able to do is to have 2 option buttons such that depending
on the selection the print area would be set and the appropriate locations
roster be printed.
OptionbuttonSW would set the print area as A$2:$H$9
OptionbuttonMW would set the print area as $A$11:$H$27

Al

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Option Buttons/Radio Buttons John Calder New Users to Excel 7 May 16th 08 03:51 AM
Option Buttons coryrey Excel Discussion (Misc queries) 1 January 6th 06 03:49 PM
Option Buttons Mike Rogers Excel Discussion (Misc queries) 2 November 21st 05 07:33 PM
Using 'Option Buttons' Julian Excel Discussion (Misc queries) 3 August 17th 05 07:36 PM
Option Buttons Grant90 Excel Discussion (Misc queries) 1 July 29th 05 02:34 PM


All times are GMT +1. The time now is 05:31 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"