Hi all,
I need help in my program code to display entire row of duplicated column A data through Column A search.
However currently i'm only able to display the first row of the search entry of the column A.
Sub inhse1()
Dim Search As String
Dim location As String
Dim Status As String
Dim Remarks As String
Dim Date1 As String
Dim inhouse As String
Dim jobcard As String
Dim firstadd As String
Dim foundcell As Range
Search = TBInHouseSN.Text
Columns("A:A").Select
Set foundcell = Range("A:A").Find(What:=Search, after:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False)
If foundcell Is Nothing Then
MsgBox "No entries found", , "Please try again"
Exit Sub
Else
firstadd = foundcell.Address
Do
Selection.Find(What:=Search, after:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
With Result
inhouse = ActiveCell.Offset.Text
jobcard = ActiveCell.Offset(0, 1).Text
location = ActiveCell.Offset(0, 2).Text
Status = ActiveCell.Offset(0, 3).Text
Remarks = ActiveCell.Offset(0, 4).Text
Date1 = ActiveCell.Offset(0, 5).Text
.AddItem (inhouse + " " + jobcard + " " + location + " " + Status + " " + Remarks + " " + Date1 + " ")
End With
Loop Until ActiveCell.Address = firstadd
End If
End Sub
Kindly give me some advise on this. Thanks. A further plan would be choose and delete the entire row from the listbox(Result).
Bookmarks