instanceofti
10-28-2015, 05:24 PM
My spreadsheet is 4 columns wide on 35000 lines long +-
I made a 3 column listbox and wish to populate it with the results of a search.
The search result will be 3 columns wide and 1 to many lines.
My search result works fine, it is the populating that isn't
[CODE]
Range("A2").Select
Do Until ActiveCell.Value = Val(Response)
If ActiveCell.Value = "" Then
MsgBox "Item Number Not Found!", vbExclamation
NotFound = 1
Exit Do
End If
ActiveCell.Offset(1, 0).Select
Loop
If ActiveCell.Value = Val(Response) Then
Frame1.Visible = True
ListBox1.AddItem ActiveCell.Offset(0, 1).Value
With ListBox1
.AddItem
.List(0, 1) = ActiveCell.Offset(0, 2).Value
.List(0, 2) = ActiveCell.Offset(0, 3).Value
End With
ActiveCell.Offset(1, 0).Select
Do Until ActiveCell.Value <> Val(Response) 'column A is sorted so this gets the next couple occurrences of the search item
ListBox1.AddItem ActiveCell.Offset(0, 1).Value
With ListBox1
.AddItem
.List(0, 1) = ActiveCell.Offset(0, 2).Value
.List(0, 2) = ActiveCell.Offset(0, 3).Value
End With
ActiveCell.Offset(1, 0).Select
Loop
I made a 3 column listbox and wish to populate it with the results of a search.
The search result will be 3 columns wide and 1 to many lines.
My search result works fine, it is the populating that isn't
[CODE]
Range("A2").Select
Do Until ActiveCell.Value = Val(Response)
If ActiveCell.Value = "" Then
MsgBox "Item Number Not Found!", vbExclamation
NotFound = 1
Exit Do
End If
ActiveCell.Offset(1, 0).Select
Loop
If ActiveCell.Value = Val(Response) Then
Frame1.Visible = True
ListBox1.AddItem ActiveCell.Offset(0, 1).Value
With ListBox1
.AddItem
.List(0, 1) = ActiveCell.Offset(0, 2).Value
.List(0, 2) = ActiveCell.Offset(0, 3).Value
End With
ActiveCell.Offset(1, 0).Select
Do Until ActiveCell.Value <> Val(Response) 'column A is sorted so this gets the next couple occurrences of the search item
ListBox1.AddItem ActiveCell.Offset(0, 1).Value
With ListBox1
.AddItem
.List(0, 1) = ActiveCell.Offset(0, 2).Value
.List(0, 2) = ActiveCell.Offset(0, 3).Value
End With
ActiveCell.Offset(1, 0).Select
Loop