Find Function

  • Thread starter Thread starter kiza
  • Start date Start date
K

kiza

Hi,

I am currently using User Forms within Excel to enable the user to mov
around quicker and easier and I would like to include a function wher
the user can delete information. The information which is being delete
is located within the Excel spreadsheet however, I am unsure what the
will decide to delete. I intend to use the "Find" Function to provid
this facility but whenever this function is activated you are require
to enter in what you are looking for.

Is there anyway in which I can have a text box to enter in th
information, click onto a macro which will automatically locate th
information that was entered into the text box?

I think that it is to do with Strings but not 100% sure.

If someone could aide me in my quest I would appreciate it.
Many Thanks
Kiz
 
Sure you can.

Define a button that will trigger the action on the userform, and add this
type of code to it

findVal = Textbox1.Text
Set oCell = Worksheets("Sheet1").Range("A1:A100"). Find _
(findVal)
If Not OCell Is Nothing Then
oCell.EntireRow.Delete
Set oCell = Nothing
End If

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top