Find Function

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
 
B

Bob Phillips

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