Listbox search at any position

yinkajewole

Active Member
Joined
Nov 23, 2018
Messages
260
@Fluff can you please create a search box for the code
Code:
Private Sub UserForm_Initialize()Dim x As Long, FileNum As Long, TotalFile As String, Lines As Variant
FileNum = FreeFile
Open "c:\Users\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 ListBox1
For x = UBound(Lines) To 0 Step -1


    .AddItem Split(Lines(x), "|")(0)
    .List(.ListCount - 1, 1) = Mid(Lines(x), InStr(1, Lines(x), "|") + 1)


Next
End With

ListBox1.ColumnWidths = "0;200"
End Sub
the columncount = -1
 
Last edited:

Some videos you may like

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
35,899
Office Version
365
Platform
Windows
This question has nothing to do with your op, so please start a new thread
 

yinkajewole

Active Member
Joined
Nov 23, 2018
Messages
260
This question has nothing to do with your op, so please start a new thread
I'm sorry, i thought it still goes along with this thread so as not to have duplication of threads, nevertheless, according to your word, i'll start a new thread, thanks
 

Watch MrExcel Video

Forum statistics

Threads
1,090,026
Messages
5,411,916
Members
403,403
Latest member
BBleaz

This Week's Hot Topics

Top