Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Importing a txt file to a ComboBox itens
Please, i need import the data txt file to a combobox list itens
How i do it -- Message posted from http://www.ExcelForum.com |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Importing a txt file to a ComboBox itens
Loop through the file and use additem to add to the combobox.
there are several ways to access the textfile Use File=Open to bring it in as a separate workbook in Excel 2000 and later, you can import it into an existing worksheet. You can use low level fileio to read the file. Post back in this thread with specific followup questions. -- Regards, Tom Ogilvy "mhferreira " wrote in message ... Please, i need import the data txt file to a combobox list itens How i do it? --- Message posted from http://www.ExcelForum.com/ |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Importing a txt file to a ComboBox itens
Try some code like the following:
Dim FName As String Dim FNum As String Dim S As String FName = "H:\test.txt" '<<<< CHANGE FILE NAME FNum = FreeFile Open FName For Input As #FNum Do Input #FNum, S Userform1.ComboBox1.AddItem S Loop Until EOF(FNum) Close #FNum -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "mhferreira " wrote in message ... Please, i need import the data txt file to a combobox list itens How i do it? --- Message posted from http://www.ExcelForum.com/ |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Importing a txt file to a ComboBox itens
The following is better, as it will properly handle an empty
input file: Dim FName As String Dim FNum As String Dim S As String FName = "H:\test.txt" '<<< CHANGE FILE NAME FNum = FreeFile Open FName For Input As #FNum Do Until EOF(FNum) Input #FNum, S Me.ComboBox1.AddItem S Loop Close #FNum -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Chip Pearson" wrote in message ... Try some code like the following: Dim FName As String Dim FNum As String Dim S As String FName = "H:\test.txt" '<<<< CHANGE FILE NAME FNum = FreeFile Open FName For Input As #FNum Do Input #FNum, S Userform1.ComboBox1.AddItem S Loop Until EOF(FNum) Close #FNum -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "mhferreira " wrote in message ... Please, i need import the data txt file to a combobox list itens How i do it? --- Message posted from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Importing text file, only option to edit existing file | Excel Discussion (Misc queries) | |||
importing file | Excel Discussion (Misc queries) | |||
reading from another file and pasting to current file, "combobox" | New Users to Excel | |||
need help getting combobox to open a file | Excel Programming | |||
Combobox Change Event when file is saved as | Excel Programming |