+ Reply to Thread
Results 1 to 2 of 2

Excel 2007 : Help Display search duplicated entries on listbox

  1. #1
    Registered User
    Join Date
    03-26-2012
    Location
    Singapore
    MS-Off Ver
    excel 2007
    Posts
    2

    Smile Help Display search duplicated entries on listbox

    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).

  2. #2
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Help Display search duplicated entries on listbox

    Hello,

    Please take a few moments and read the forum rules, add code tags around your code and don't start a new thread for the same problem since this seems to be a duplicate of your last thread. If it is, please continue in the original thread. If not, I apologize for the mix-up and please post a dummy workbook.

    Thanks.

    abousetta
    Please consider:

    Thanking those who helped you. Click the star icon in the lower left part of the contributor's post and add Reputation.
    Cleaning up when you're done. Mark your thread [SOLVED] if you received your answer.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1