Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Input Box w/Drop Down List

I need to have an input box launch that would provide the user with a drop
down box of selections, then upon their selection, would take then to a
certain sheet of a workbook.

I can write the macro - what is baffling me is how to program the drop down
list into the input box instead of having the user type something.

Can this be done?


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,069
Default Input Box w/Drop Down List

If you just want something that shows a list of all worksheet names in the
active workbook & from user selection, then selects choosen sheet then
following may do what you want:

Sub SelectSheet()
If ActiveWorkbook.Sheets.Count <= 16 Then
application.CommandBars("Workbook Tabs").ShowPopup 500, 225
Else
application.CommandBars("Workbook Tabs").Controls("More
Sheets...").Execute
End If
End Sub
--
jb


"PMarble" wrote:

I need to have an input box launch that would provide the user with a drop
down box of selections, then upon their selection, would take then to a
certain sheet of a workbook.

I can write the macro - what is baffling me is how to program the drop down
list into the input box instead of having the user type something.

Can this be done?


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default Input Box w/Drop Down List

No, Not with a message box. You can do this using a vba userform.

Add the following to your main sub to show the form.
Public Sub Main()
UserForm1.Show
End Sub

add a combobox and commandbutton to the form with the following code.
Private Sub UserForm_Initialize()
Dim s As Worksheet
Me.ComboBox1.ListRows = Sheets.Count
For Each s In Sheets
Me.ComboBox1.AddItem s.Name, s.Index - 1
Next s
End Sub

Private Sub CommandButton1_Click()
' Call MySub(ComboBox1.Value)
Sheets(ComboBox1.Value).Activate
Unload Me
End Sub


"PMarble" wrote:

I need to have an input box launch that would provide the user with a drop
down box of selections, then upon their selection, would take then to a
certain sheet of a workbook.

I can write the macro - what is baffling me is how to program the drop down
list into the input box instead of having the user type something.

Can this be done?


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default Input Box w/Drop Down List

John, I like your method. I did not know this was available.

"john" wrote:

If you just want something that shows a list of all worksheet names in the
active workbook & from user selection, then selects choosen sheet then
following may do what you want:

Sub SelectSheet()
If ActiveWorkbook.Sheets.Count <= 16 Then
application.CommandBars("Workbook Tabs").ShowPopup 500, 225
Else
application.CommandBars("Workbook Tabs").Controls("More
Sheets...").Execute
End If
End Sub
--
jb


"PMarble" wrote:

I need to have an input box launch that would provide the user with a drop
down box of selections, then upon their selection, would take then to a
certain sheet of a workbook.

I can write the macro - what is baffling me is how to program the drop down
list into the input box instead of having the user type something.

Can this be done?


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,069
Default Input Box w/Drop Down List

it's simple & useful although I can't claim originality - it was something I
was shown in days upgrading to 2003.
--
jb


"Kent Prokopy" wrote:

John, I like your method. I did not know this was available.

"john" wrote:

If you just want something that shows a list of all worksheet names in the
active workbook & from user selection, then selects choosen sheet then
following may do what you want:

Sub SelectSheet()
If ActiveWorkbook.Sheets.Count <= 16 Then
application.CommandBars("Workbook Tabs").ShowPopup 500, 225
Else
application.CommandBars("Workbook Tabs").Controls("More
Sheets...").Execute
End If
End Sub
--
jb


"PMarble" wrote:

I need to have an input box launch that would provide the user with a drop
down box of selections, then upon their selection, would take then to a
certain sheet of a workbook.

I can write the macro - what is baffling me is how to program the drop down
list into the input box instead of having the user type something.

Can this be done?




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 45
Default Input Box w/Drop Down List

Cool :-)

Neat little trick - thanks for sharing :-)



"john" skrev i en meddelelse
...
If you just want something that shows a list of all worksheet names in the
active workbook & from user selection, then selects choosen sheet then
following may do what you want:

Sub SelectSheet()
If ActiveWorkbook.Sheets.Count <= 16 Then
application.CommandBars("Workbook Tabs").ShowPopup 500, 225
Else
application.CommandBars("Workbook Tabs").Controls("More
Sheets...").Execute
End If
End Sub
--
jb


"PMarble" wrote:

I need to have an input box launch that would provide the user with a
drop
down box of selections, then upon their selection, would take then to a
certain sheet of a workbook.

I can write the macro - what is baffling me is how to program the drop
down
list into the input box instead of having the user type something.

Can this be done?




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
Drop down list with ability to add variable input Rocky Excel Programming 0 August 21st 08 04:36 PM
Need to make a drop down list of 3 items that input a value in ano solarflare New Users to Excel 2 March 14th 08 10:58 PM
Input data form with drop down list PA Excel Programming 3 May 1st 06 12:17 AM
input range in drop down list Otto Excel Discussion (Misc queries) 3 July 27th 05 09:09 PM
Input Box Drop-Down List Chris Morgan Excel Programming 1 November 7th 03 04:40 PM


All times are GMT +1. The time now is 04:33 AM.

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"