Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default I want user to select the worksheet

Hi,

I want user to select the sheet he needs for a data selection. I am able to
se a form so they can chose the workbook, but I cannot figure out how to do
it for a worksheet. I am afraid they can be name differently.

Thanks!
--
Mathieu
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 703
Default I want user to select the worksheet

Hi Mathieu

With a listbox and a commandbutton on a form I thikn this can help
you:

Private Sub CommandButton1_Click()
SelectedWsh = Me.ListBox1.ListIndex
MsgString = Sheets(SelectedWsh + 1).Name & " was selected"
Msg = MsgBox(MsgString)
End Sub

Private Sub UserForm_Initialize()
Dim wb As Workbook
Set wb = ActiveWorkbook
For Each sh In wb.Sheets
Me.ListBox1.AddItem sh.Name
Next
End Sub

Regards,
Per

On 24 Okt., 20:15, Mathieu wrote:
Hi,

I want user to select the sheet he needs for a data selection. I am able to
se a form so they can chose the workbook, but I cannot figure out how to do
it for a worksheet. I am afraid they can be name differently.

Thanks!
--
Mathieu


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
Programmatically allowing user to select worksheet Barb Reinhardt Excel Programming 2 November 27th 07 06:08 PM
Prompt user to select a printer using a checkbox within a user Tom Ogilvy Excel Programming 0 January 10th 07 03:57 AM
User select row? rudini Excel Programming 3 September 9th 05 02:42 PM
In Excel 2000, How do you select the whole of a worksheet (Select. Rascal Excel Discussion (Misc queries) 1 March 5th 05 12:03 AM
In Excel 2000, How do you select the whole of a worksheet (Select. Rascal Excel Discussion (Misc queries) 1 March 4th 05 11:59 PM


All times are GMT +1. The time now is 11:30 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"