Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Listbox in userform and printing sheets listed in the list box

Status
Not open for further replies.

ease20022002

Technical User
Jun 14, 2005
41
US
Hi, I am trying to select multiple selections from a list box from a user form. The list consists of various sheet names.

I have set the list box up for multiple selections and I am trying to print all of the sheets that were selected from this form.

Here is the code I have been working on. Any help would be appreciated.

Private Sub CommandButton1_Click()
Dim wsName As Variant
With ListBox2
For i = 0 To .ListCount - 1
If .Selected(i) Then
wsName

End If
Next i
End With
End Sub

 

You have to build an array to reference multiple sheets
Code:
with Sheets(Array("Sheet2", "Sheet1"))

end with


Skip,

[glasses] [red]A palindrome gone wrong?[/red]
A man, a plan, a ROOT canal...
PULLEMALL![tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top