Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 88
Default Find a string with a text paragraph

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 834
Default Find a string with a text paragraph


If Not IsError(Application.Match(Me.TextBox1.Text,
Sheets("Data").range(B3:B40") , 0) ) Then

MsgBox "Don't be obscene"
Me.TextBox1.Text = ""
End If

--

HTH

Bob

"leerem" wrote in message
...
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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Find a string with a text paragraph

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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 88
Default Find a string with a text paragraph

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

  #5   Report Post  
Posted to microsoft.public.excel.programming
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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Search, find or lookup defined text in text string zzxxcc Excel Worksheet Functions 9 September 6th 07 09:37 PM
find/replace paragraph mark jen_writer Excel Discussion (Misc queries) 2 February 24th 07 12:26 AM
can you find specific text in a string ignoring any other text chriscp Excel Discussion (Misc queries) 1 September 18th 05 09:54 PM
how to Detect paragraph in cell in string? dm16s Excel Programming 1 June 22nd 05 09:22 PM
backwards find function to find character in a string of text Ashleigh K. Excel Programming 1 January 14th 04 04:36 PM


All times are GMT +1. The time now is 08:50 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"