Using Forms combo box selection

S

SundayGirl

Hi

I have a form which displays all sheets in the workbook. I want the user to
be able to select the sheet(s) and click the button to open them. This is
my code so far.

Private Sub UserForm_Initialize()
Dim ws As Worksheet

For Each ws In Worksheets
With Me.LBView

.AddItem ws.Name
.List(.ListCount - 1, 1) = .RowSource

End With
Next ws

End Sub

Excel 2000

Thanks

Ruth
 
J

john

If you add a button to your userform something like following should work.

Private Sub CommandButton1_Click()
Worksheets(Me.LBView.Text).Activate
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top