Hello,

In my "Search Records"userform I want that the "List Box" should show me data from Sheet1 only from Column A, Column B, Column E, and
Column F.

I want data should be shown in the " LIST BOX " as Horizental Not vertical.

Here is the code:





Dim SearchRecords As Long

Private Sub CheckBox2_Change()
'MATCH WHOLE WORD
If CheckBox2.Value = True Then
CheckBox2.Tag = "1"
Else
CheckBox2.Tag = "2"
End If
End Sub

Private Sub CommandButton2_Click()
'SEARCH

StartRow = 2

Col = ComboBox1.ListIndex + 1
If Col = 0 Then
MsgBox "Please choose a category."
Exit Sub
End If

If TextBox1.Text = "" Then
MsgBox "Please enter a search term."
TextBox1.SetFocus
Exit Sub
End If

LastRow = Cells(Rows.Count, Col).End(xlUp).Row
LastRow = IIf(LastRow < StartRow, StartRow, LastRow)

Set Rng = Range(Cells(2, Col), Cells(LastRow, Col))

Set FoundMatch = Rng.Find(What:=TextBox1.Text, _
After:=Rng.Cells(1, 1), _
LookAt:=CInt(CheckBox2.Tag), _
LookIn:=xlValues, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=CheckBox1.Value)

If Not FoundMatch Is Nothing Then
FirstAddx = FoundMatch.Address
ListBox1.Clear

Do
Cnt = Cnt + 1
R = FoundMatch.Row
ListBox1.AddItem " " & D

For Each C In Range(Cells(R, "A"), Cells(R, "M"))
ListBox1.AddItem C.Text
Next C
Set FoundMatch = Rng.FindNext(FoundMatch)
A = FoundMatch.Address
Loop While CheckBox3 = True And FoundMatch.Address <> FirstAddx And Not FoundMatch Is Nothing
Label1.Caption = "Matches =" & Str(Cnt)
SearchRecords = Cnt
Else
ListBox1.Clear
Label1.Caption = ""
SearchRecords = 0
MsgBox "No match found for " & TextBox1.Text
End If

End Sub

Private Sub CommandButton3_Click()
'BACK ONE SEARCH RECORD
Dim CntDown As Long

If SearchRecords <> 0 Then
Select Case ListBox1.ListIndex
Case Is < 13
ListBox1.TopIndex = 0
ListBox1.ListIndex = 0
Case Is > 13
CntDown = ((ListBox1.ListIndex \ 14) * 14) - 14
ListBox1.TopIndex = CntDown
ListBox1.ListIndex = CntDown
End Select
End If

End Sub

Private Sub CommandButton4_Click()
'NEXT SEARCH RECORD

Dim CntDown As Long

If SearchRecords <> 0 Then
Select Case ListBox1.ListIndex
Case Is < 14
ListBox1.TopIndex = 14
ListBox1.ListIndex = 14
Case Is < ListBox1.ListCount - 14
CntDown = ((ListBox1.ListIndex \ 14) * 14) + 14
ListBox1.TopIndex = CntDown
ListBox1.ListIndex = CntDown
End Select
End If

End Sub

Private Sub Frame2_Click()

End Sub

Private Sub Frame3_Click()

End Sub

Private Sub ListBox1_Click()

End Sub

Private Sub UserForm_Activate()

AddToForm MIN_BOX
AddToForm MAX_BOX

With ComboBox1
For I = 1 To 13
.AddItem Cells(1, I)
Next I
.SetFocus
End With

End Sub



I would be thankful If anyone could help me..

Thank you