Search For Text on Non Active Worksheet

  • Hi,



    I find some difficulty doing this thing, can anyone help me out in it.



    For Data Range i given name is ("DataRange") & For Sheet its ("Dec07")



    Data Entry Fields:



    1) First Name (txtfn)


    2) Last Name (txtln)


    3) Address (txtadd)


    4) Dateof birth (txtdob)


    5) Date of Joining (txtdoj)


    6) Status Combo Box (cbostat)





    Query:



    When i type a search content in Search Text Box & when i hit to Search Button it give me some error, actually i want that searched data should display in List Box1 in excel format (Column Wise)

  • Re: Search In Text Box (txtsearch) & Display In List Box (listbox1) On User Form


    Try changing the reference in the search routine. As the range DataRange is not on the Data sheet as you code currently suggests.


    [vba]
    With Sheets("Dec07")
    Set r = .Range("DataRange").Find(What:=res, LookAt:=xlWhole, LookIn:=xlValues, MatchCase:=False)
    [/vba]

    [h4]Cheers
    Andy
    [/h4]

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!