Mình có combobox1 trên form được add dữ liệu = code sau
* Làm thế nào để sort dữ liệu trong combobox1 theo a, b, c ...? (file Doc.txt không có tiếng việt)
* Làm thế nào để loại bỏ dòng trắng ko có dữ liệu trong combobox mà không phải xoá thủ công trên file doc.txt
Many tks
Mã:
Private Sub UserForm_Initialize()
Dim InFile As Integer
InFile = FreeFile
Open ThisWorkbook.Path & "\" & "Doc.txt" For Input As InFile '[COLOR=#ff0000]file doc.txt nằm cùng folder với file excel[/COLOR]
While Not EOF(InFile)
Line Input #InFile, NextLine
ComboBox1.AddItem NextLine
Wend
Close InFile
End Sub
* Làm thế nào để loại bỏ dòng trắng ko có dữ liệu trong combobox mà không phải xoá thủ công trên file doc.txt
Many tks
File đính kèm
Lần chỉnh sửa cuối: