Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Search, find or lookup defined text in text string | Excel Worksheet Functions | |||
find/replace paragraph mark | Excel Discussion (Misc queries) | |||
can you find specific text in a string ignoring any other text | Excel Discussion (Misc queries) | |||
how to Detect paragraph in cell in string? | Excel Programming | |||
backwards find function to find character in a string of text | Excel Programming |