yinkajewole
Active Member
- Joined
- Nov 23, 2018
- Messages
- 281
Please, I need a search textbox for this code
The listbox ColumnCount = -1
Code:
Private Sub UserForm_Initialize()
Dim x As Long, FileNum As Long, TotalFile As String, Lines As Variant
FileNum = FreeFile
Open "C:\Temp\History.txt" For Binary As [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FileNum]#FileNum[/URL]
TotalFile = Space(LOF(FileNum))
Get [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FileNum]#FileNum[/URL] , , TotalFile
Close [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FileNum]#FileNum[/URL]
Lines = Split(TotalFile, vbCrLf)
With rList
For x = UBound(Lines) To 0 Step -1
.AddItem Replace(Lines(x), "|", vbNullChar, , 1)
.List(.ListCount - 1, 1) = Mid(Lines(x), InStr(1, Lines(x), "|") + 1)
Next
End With
rList.ColumnWidths = "0;200"
End Sub