Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Help! Excel Has Gone Nuts! | Excel Discussion (Misc queries) | |||
My Boss is nuts | Excel Worksheet Functions | |||
Need Help, this is driving me nuts | Excel Discussion (Misc queries) | |||
This drives me nuts | Excel Programming | |||
listbox.value not equal to listbox.list(listbox.listindex,0) | Excel Programming |