Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Using Forms combo box selection

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



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,069
Default Using Forms combo box selection

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

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


"SundayGirl" wrote:

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




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
Archiving user selection from Drop Down (forms - combo box) Meg Excel Discussion (Misc queries) 1 July 31st 08 02:53 PM
Forms Combo Box Gilda Excel Worksheet Functions 1 February 25th 08 05:32 PM
Combo Box selection only shows bound column info after selection made. Coby Excel Programming 1 October 18th 07 02:04 AM
Populate one combo box based on the selection of another combo box Alex Excel Programming 8 April 19th 07 06:40 PM
Combo Box vba that works like Forms Menu combo box Hector Fernandez Excel Programming 4 December 12th 06 08:30 PM


All times are GMT +1. The time now is 12:36 PM.

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

About Us

"It's about Microsoft Excel"