Search Macro to display all possible details

  • Hi,


    Can you please give me an idea how to create a macro that will display the contents of the entire row in reference to column A?


    Basically, in the data below, if I search for "tek" it will display all instances of the word "tek" from column a including column b and c.


    A B C
    Name data1 data2
    Tek 1 2
    Tekx 3 3
    Tekc 3 4
    Gup 3 4
    Gaz 3 3
    Gazc 5 5


    So my output popup would be like below. It should show the Column labels not just the contents
    Name data1 data2
    Tek 1 2
    Tekx 3 3
    Tekc 3 4


    Thanks in advance!

  • Re: Search Macro to display all possible details


    Quote from PCI;639256

    Did you ever try AutoFilter and use Text Filters with Tek content


    I can use the auto filter but I want something easier for a not so techie user. that's why I thought of having a button search macro and popup output. Thanks!

  • Re: Search Macro to display all possible details


    What about next macro
    In the file attached use Control + G to launch it

    Code
    Sub In_Msg()
    Dim MyInfo As Variant
        MyInfo = Application.InputBox("Enter a reference to find")
        If (ActiveSheet.AutoFilterMode) Then ActiveSheet.AutoFilterMode = False '  REMOVE  AUTOFILTER  IF  EXIST
        ActiveSheet.Range("$A$1:$C$7").AutoFilter Field:=1, Criteria1:=MyInfo & "*", Operator:=xlFilterValues
    End Sub
  • Re: Search Macro to display all possible details


    Quote from PCI;639391

    What about next macro
    In the file attached use Control + G to launch it

    Code
    Sub In_Msg()
    Dim MyInfo As Variant
        MyInfo = Application.InputBox("Enter a reference to find")
        If (ActiveSheet.AutoFilterMode) Then ActiveSheet.AutoFilterMode = False '  REMOVE  AUTOFILTER  IF  EXIST
        ActiveSheet.Range("$A$1:$C$7").AutoFilter Field:=1, Criteria1:=MyInfo & "*", Operator:=xlFilterValues
    End Sub


    thanks a lot! the macro works but can the output be a popup window? also can the headers (Name data1 data2) be included the in output? thanks a lot again!

  • Re: Search Macro to display all possible details


    Quote from PCI;639469

    A popup window is not to small to make the complete display?


    ok.. I just made a userform that when they exit, it will display all contents again :) thanks a lot for your help! :)

Participate now!

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