very simple this should do it
Code:
Private Function ReadFile(FilePath As String)
Dim i As Integer, FF As Integer, Num As Integer
Dim s As String, ReadLine As String, sLine() As String
FF = FreeFile
Open FilePath For Input As #FF
Do Until EOF(FF)
Line Input #FF, ReadLine
s = s & Trim(ReadLine) & ","
Loop
Close #FF
sLine = Split(s, ",")
Num = CInt(Right(sLine(16), Len(sLine(16)) - 3))
Select Case Num
Case 1
For i = 0 To 15
If sLine(i) = "0" Then chkp1(i + 1).AddItem sLine(i)
Next
Case 2
For i = 0 To 15
If sLine(i) = "0" Then chkp2(i + 1).AddItem sLine(i)
Next
Case 3
For i = 0 To 15
If sLine(i) = "0" Then chkp3(i + 1).AddItem sLine(i)
Next
Case 4
For i = 0 To 15
If sLine(i) = "0" Then chkp4(i + 1).AddItem sLine(i)
Next
End Select
End Function
Code:
Private Sub Command1_Click()
ReadFile "C:\File.txt"
End Sub
This was based on a file example like this
Code:
0
0
0
1
0
0
0
1
1
1
1
0
1
1
0
0
# P1 continue
now if there was something written after the 1's and 0's you could modify a bit
Example
Code:
Select Case Num
Case 1
For i = 0 To 15
If Left(sLine(i), 1) = "0" Then chkp1(i + 1).AddItem Right(sLine(i), Len(sLine(i)) - 2) Next
'.....and change for every case
End Select