Listbox search at any position

yinkajewole

Board Regular
Joined
Nov 23, 2018
Messages
212
@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:

Fluff

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

yinkajewole

Board Regular
Joined
Nov 23, 2018
Messages
212
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
 

Forum statistics

Threads
1,081,702
Messages
5,360,738
Members
400,594
Latest member
Frothingslosh

Some videos you may like

This Week's Hot Topics

  • VBA (Userform)
    Hi All, I just would like to know why my code isn't working. Here is my VBA code: [CODE=vba]Private Sub OKButton_Click() Dim i As Integer...
  • List box that changes fill color
    Hello, I have gone through so many pages trying to figure this out. I have a 2020 calendar that depending on the day needs to have a certain...
  • Remove duplicates and retain one. Cross-linked cases
    Hi all I ran out of google keywords to use and still couldn't find a reference how to achieve the results of a single count. It would be great if...
  • VBA Copy and Paste With Duplicates
    Hello All, I'm in need of some input. My VBA skills are sub-par at best. I've assembled this code from basic research and it works but is...
  • Macro
    is it possible for a macro to run if the active cell value is different to the value above it
  • IF DATE and TIME
    I currently use this to check if date has passed but i also need to set a time on it too. Is it possible? [CODE=vba]=IF(B:B>TODAY(),"Not...
Top