Hey Jake thanks again. The new code works great.....with one exception. But I was able to fix it! I had become a little frustrated and moved the last two samples (pos control and neg control) to the top of the list so that it wouldn't have to sort all the way through the list. But my code wouldn't account for an empty row. Your code does! I altered yours to have a different temp variable to load the array so that it won't increment if the search value is null. This prevents an empty row being loaded into the array when the search functions as it should.
Private Sub UserForm_Initialize()
Dim MyArray() As String
Dim i As Long
Dim k As Long
ReDim MyArray(67 To 111, 1 To 2)
Windows("Book2.xls").Activate
Sheets("Sheet1").Select
k = 67
For i = 67 To 111
If Range("E" & i).Text <> "" Then
MyArray(k, 1) = Range("E" & i).Text
MyArray(k, 2) = Range("F" & i).Text
k = k + 1
End If
Next
Me.ListBox1.List = MyArray
End Sub
One more question. I have tried to load the first value of the array as the header columns in the listbox and have been unsuccessful. From what I have read I think this can only be done with a 'range' of data. Is this true or is there a secret that I can't find in my long two weeks of learning vba!?
Again thanks for all your help. I have changed other areas of my project (not posted here) to improve the code dramatically.
Mark