How do I make a list of clients appear in a search from the name in Excel? [closed]

0

I have a list of clients; I want to do a search where you enter part of the client's name and then all clients that have that name appear. Example:

Customers' Rationale: João da Silva ME; Mariazinha Me; João Vitor ME; ...

Search: John

The result should appear all customers that have John in the corporate name. How do I do this in Excel?

    
asked by anonymous 05.10.2018 / 21:25

1 answer

1

Depending on the context in which your table is, you can use it in a variety of ways to get this information.

I suggest using Excel tables to make it even easier to enter data:

Ifyouhaveanyquestionsabouthowtocreateonyoutubeyouhaveseveraltutorialsforthisorclick here

After having your table just use the filter to search by name ...

As indicated below:

Now...ifyouareusingamacroyoucancreateamacrotohelpwiththissearch,itwouldbesimple:

FunctionPesquisar(ByValTEXTO_A_SER_PESQUISADOAsString)ActiveSheet.ListObjects("Tabela1").Range.AutoFilter _
            Field:=1, _
            Criteria1:="=*" & TEXTO_A_SER_PESQUISADO & "*", _
            Operator:=xlAnd
End Function

And using the example image below:

PutthiscodeinWorksheet_Change:

PrivateSubWorksheet_Change(ByValTargetAsRange)IfTarget.Address="$A$1" Then
        Pesquisar (Target.Text)
    End If

End Sub

Here is a sample worksheet.

Or if you have a form you can use this macro to populate a combobox with the result of your search.

There is a complete module to work with Excel tables available here.

I hope I have helped!

    
06.10.2018 / 11:33