Team,
Based on earlier suggestion, I have prepared the below code.
I created a user form, image attached.
Let me give you an insight into how it works for easy understanding.
As you see the image, its optional for the user to select the dates.
User has 2 options Select from List and Instant Search.
When the user selects Instant Search, text box is focused and user can type the initials of the person, he is looking for and the list box displays 2 rows of Manager Name and Emp Name.
Problem Area
Only 2 Columns are displayed, I want 5 columns with the data from the sheet.
I can change the column count in listbox propertly, but how do i get more data in list box columns.
The Raw Data i have has Columns starting from A to AB, and i need the data in List box from col I to M.
Below is the code, and this works fine for 2 columns
Cannot attach File due to security reason
Based on earlier suggestion, I have prepared the below code.
I created a user form, image attached.
Let me give you an insight into how it works for easy understanding.
As you see the image, its optional for the user to select the dates.
User has 2 options Select from List and Instant Search.
When the user selects Instant Search, text box is focused and user can type the initials of the person, he is looking for and the list box displays 2 rows of Manager Name and Emp Name.
Problem Area
Only 2 Columns are displayed, I want 5 columns with the data from the sheet.
I can change the column count in listbox propertly, but how do i get more data in list box columns.
The Raw Data i have has Columns starting from A to AB, and i need the data in List box from col I to M.
Below is the code, and this works fine for 2 columns
Cannot attach File due to security reason
Code:
Private Sub InstantEmp_Change()
Dim i As Long
Me.InstantEmp.Text = StrConv(Me.InstantEmp.Text, vbProperCase)
Me.DataResult.Clear
For i = 2 To Application.WorksheetFunction.CountA(Sheet1.Range("I:I"))
a = Len(Me.InstantEmp.Text)
If Left(Sheet1.Cells(i, 9).Value, a) = Left(Me.InstantEmp.Text, a) Then
Me.DataResult.AddItem Sheet1.Cells(i, 10).Value
Me.DataResult.List(DataResult.ListCount - 1, 1) = Sheet1.Cells(i, 9).Value
End If
Next i
End Sub