View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Mike H Mike H is offline
external usenet poster
 
Posts: 11,501
Default Find a string with a text paragraph

Your welcome
--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.


"leerem" wrote:

Many many thanks mike

"Mike H" wrote:

Hi,

You could use the after-update event to check the contents against you list

Private Sub TextBox1_AfterUpdate()
Dim MyRange As Range
Set MyRange = Sheets("Data").Range("B3:B40")
If Not IsError(Application.Match(TextBox1.Text, MyRange, 0)) Then
MsgBox "Word not Allowed"
TextBox1.Text = ""
End If
End Sub
--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.


"leerem" wrote:

Gents, I need your expertise once again,

I have a fault log (userform) which has a text box placed on it, for
information regarding the fault on hand. However I want to ensure that this
text box isn't used for vulgar words etc.
I have a list of such words held on Sheets("Data").range(B3:B40") and wish
to check this list against the text within the text box.

How do i go about writing a function, that will be able to do such a task.

your assistance would be most appreciated

regards

Lee