Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I need to get input from the user as to what kind of file (i.e. files with a specific file extension) he is interested in operating the macro on. I want to have a drop down menu with some file extension options for the user to choose from. Once the User chooses the file extension the macro should begin running (with the file extension information used in the macro). The file extension should be stored as a variable and passed on to the main macro. How can I implement this. Please help. Thanks Srikanth |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Right click Forms, insert UserForm
Add a combobox to your form by dragging it from your tool box. Double click ThisWorkbook and enter: Private Sub Workbook_Open() userform1.ComboBox1.AddItem "txt" userform1.ComboBox1.AddItem "doc" userform1.ComboBox1.AddItem "xls" userform1.ComboBox1.AddItem "pdf" 'Use drop-down list userform1.ComboBox1.Style = fmStyleDropDownList 'Combo box values are ListIndex values userform1.ComboBox1.BoundColumn = 0 'Set combo box to first entry userform1.ComboBox1.ListIndex = 0 Load userform1 userform1.Show End Sub Double click your combobox and enter: Private Sub ComboBox1_Change() Dim strExtension As String strExtension = userform1.ComboBox1.Text 'insert your code, or call your module her End Sub "Srikanth Ganesan" wrote in message ... Hi, I need to get input from the user as to what kind of file (i.e. files with a specific file extension) he is interested in operating the macro on. I want to have a drop down menu with some file extension options for the user to choose from. Once the User chooses the file extension the macro should begin running (with the file extension information used in the macro). The file extension should be stored as a variable and passed on to the main macro. How can I implement this. Please help. Thanks Srikanth |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort | Excel Worksheet Functions | |||
My excel macro recorder no longer shows up when recording macro | Excel Discussion (Misc queries) | |||
My excel macro recorder no longer shows up when recording macro | Excel Discussion (Misc queries) | |||
Excel Macro Issue Trying to autorun Macro Upon Opening Worksheet | Excel Programming |