View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jacob Skaria Jacob Skaria is offline
external usenet poster
 
Posts: 8,520
Default Userform with option buttons to print selected sheets

How about using a combo box. Place a combobox and command button in a
userform and try the below code


Private Sub CommandButton1_Click()
ThisWorkbook.Sheets(Me.ComboBox1.Text).PrintOut Copies:=1, Collate:=True
End Sub

Private Sub UserForm_Initialize()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Sheets
Me.ComboBox1.AddItem ws.Name
Next
End Sub

--
Jacob


"Roger on Excel" wrote:

Can anyone help me with code to help me buid a userform in which a user
selects the sheets in the workbook to print using option buttons ?

Once the user has selected the sheets another button prints them

Can anyone help?

Thankyou,

Roger