Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default GUI in Excel Macro

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default GUI in Excel Macro

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
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
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort Gavin Excel Worksheet Functions 0 May 17th 07 01:20 PM
My excel macro recorder no longer shows up when recording macro jack Excel Discussion (Misc queries) 1 February 5th 07 09:31 PM
My excel macro recorder no longer shows up when recording macro jack Excel Discussion (Misc queries) 3 February 5th 07 08:22 PM
Excel Macro Issue Trying to autorun Macro Upon Opening Worksheet wyndman Excel Programming 2 May 25th 04 06:59 PM


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