Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Soup to nuts listbox help needed

I've created a userform before but it was a long time ago and I don't
have it or the resources I used to create it available, so I need some
help.

The goal is to have a userform open upon clicking on a custom toolbar
button that will have a listbox with "English" names for web pages
whose URL is dynamic (www.mysite.com?page=4&dept=74&lang=-1). When a
user selects the English name from the dropdown, it will be used to
reference both the URL (for a web query - already written and working)
and a worksheet that contains data for the webpage. The macro is in a
hidden workbook, so I do have the option of creating a table to lookup
the values for the English name.

I have the userform created with the listbox and buttons on it I need,
but I don't know how to load the English names into the listbox, have
the listbox pop up, and then how to have the existing macro reference
the needed values based on the listbox choice.

TIA,
Jim

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Soup to nuts listbox help needed

Perhaps this will give some ideas.

in a General Module:

Sub Showform()
Userform1.show
End Sub

in the Userform1 module

Private Sub Userform_Initialize()
set rng = Workbooks("Data.xls").Worksheets("MyNames").Range( "A1:A10")
Listbox1.List = rng.Value
End Sub

Private Sub CommandButton1_Click()
if Listbox1.ListIndex < -1 then
sEnglishName = Listbox1.Value
Application.Run "Data1.xls!Macro1",sEnglishName
' work on pages using sEnglishName
End if
End Sub


---
in the workbook Data1 you would have a macro named macro1

Sub Macro1(sName as String)
' execute web query using sName
End Sub


--
Regards,
Tom Ogilvy


"Jim" wrote in message
ups.com...
I've created a userform before but it was a long time ago and I don't
have it or the resources I used to create it available, so I need some
help.

The goal is to have a userform open upon clicking on a custom toolbar
button that will have a listbox with "English" names for web pages
whose URL is dynamic (www.mysite.com?page=4&dept=74&lang=-1). When a
user selects the English name from the dropdown, it will be used to
reference both the URL (for a web query - already written and working)
and a worksheet that contains data for the webpage. The macro is in a
hidden workbook, so I do have the option of creating a table to lookup
the values for the English name.

I have the userform created with the listbox and buttons on it I need,
but I don't know how to load the English names into the listbox, have
the listbox pop up, and then how to have the existing macro reference
the needed values based on the listbox choice.

TIA,
Jim



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Soup to nuts listbox help needed

Tom,

That's great - this will get me started (although I may be back with
more questions).

Thanks,
Jim

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
Help! Excel Has Gone Nuts! Gordon Arnaut Excel Discussion (Misc queries) 2 July 6th 07 03:40 AM
My Boss is nuts John21 Excel Worksheet Functions 1 August 4th 06 06:15 PM
Need Help, this is driving me nuts heitorfjr Excel Discussion (Misc queries) 2 January 15th 06 03:10 PM
This drives me nuts Pete K Excel Programming 5 April 9th 04 10:49 PM
listbox.value not equal to listbox.list(listbox.listindex,0) ARB Excel Programming 0 October 22nd 03 12:46 AM


All times are GMT +1. The time now is 01:10 AM.

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

About Us

"It's about Microsoft Excel"