Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
uwe uwe is offline
external usenet poster
 
Posts: 6
Default Populate combo box with external data

Hi,

Help please! I've been trying to find the right code to do the
following but I just can't seem to find the right thing.

OK, I have created a combo box as a user form. The combo box needs to
be populated with several folders found in the same location, let's
say c:\projects

Then the user will have to click on one of those folders which contain
text files. So, I think I will need a subfolder in the combo box which
will display those files and finally the user will click on one of
them.

Is this possible on just one combo box or do I need two combo boxes
linked to each other?

Any help with the code would be greatly appreciated,
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Populate combo box with external data

See if this helps

Sub Fillcombobox()

Do
fileToOpen = Application _
.GetOpenFilename("Text Files (*.txt), *.txt")
If fileToOpen < False Then
'Open file and
'Load you combobox here
End If
Msg = "Do you want to load Combobox with another file?"
Response = MsgBox(Msg, vbYesNo, "Get Data")
Loop While Response = vbYes

End Sub


"uwe" wrote:

Hi,

Help please! I've been trying to find the right code to do the
following but I just can't seem to find the right thing.

OK, I have created a combo box as a user form. The combo box needs to
be populated with several folders found in the same location, let's
say c:\projects

Then the user will have to click on one of those folders which contain
text files. So, I think I will need a subfolder in the combo box which
will display those files and finally the user will click on one of
them.

Is this possible on just one combo box or do I need two combo boxes
linked to each other?

Any help with the code would be greatly appreciated,

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Populate combo box with external data

On Sep 11, 1:34*am, Joel wrote:
See if this helps

Sub Fillcombobox()

Do
* *fileToOpen = Application _
* * * .GetOpenFilename("Text Files (*.txt), *.txt")
* *If fileToOpen < False Then
* * * 'Open file and
* * * 'Load you combobox here
* *End If
* *Msg = "Do you want to load Combobox with another file?"
* *Response = MsgBox(Msg, vbYesNo, "Get Data")
Loop While Response = vbYes

End Sub



"uwe" wrote:
Hi,


Help please! I've been trying to find the right code to do the
following but I just can't seem to find the right thing.


OK, I have created a combo box as a user form. The combo box needs to
be populated with several folders found in the same location, let's
say c:\projects


Then the user will have to click on one of those folders which contain
text files. So, I think I will need a subfolder in the combo box which
will display those files and finally the user will click on one of
them.


Is this possible on just one combo box or do I need two combo boxes
linked to each other?


Any help with the code would be greatly appreciated,- Hide quoted text -


- Show quoted text -



I am working with 2 listBoxes now and the files I would like to
populate have the extension .JAE and they are located in C:\Projects.
The first listBox should populate all fileNames with that extension in
that folder. Selecting one of the populated fileNames should start
Marcro1, which I already have and it writes that file into an Excel
workbook. The second listbox should populate the columns B and C, out
of that workbook. Selection of one of the populated values should
start Macro2.
I have already both macros, they are working fine if I start them from
Excel.

Hope you can help.
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
Populate text box or combo box with external files with links to file names retterjr Links and Linking in Excel 0 February 18th 12 03:47 AM
How to populate Combo Box ?? dennis logan Excel Programming 3 October 11th 07 01:51 PM
Populate one combo box based on the selection of another combo box Alex Excel Programming 8 April 19th 07 06:40 PM
Populate a combo box damorrison Excel Discussion (Misc queries) 11 September 3rd 06 09:04 PM
How do I import external data populate rows instead of columns. KWE39 Excel Discussion (Misc queries) 0 July 1st 05 09:53 PM


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