If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
[vba-newbie] testing cell text for specific characters?
I would like to test the text value of a cell to determine if it
includes a certain string of characters and set a variable to true when appicable. In other words, something like this (unknown method in human syntax and italics) : -If Range["A1"] text string includes 'thisText' Then- boolVariableName = True End If Is there a built -in way to do this with VBA? I'm sure there is, but I haven't been able to locate the appropriate funtion in the help files, this forum, or via google. Can anyone assist? --- Message posted from http://www.ExcelForum.com/ |
#2
|
|||
|
|||
One way:
boolVariableName = InStr(Range("A1").Text, "thisText") 0 In article , counterform wrote: I would like to test the text value of a cell to determine if it includes a certain string of characters and set a variable to true when appicable. In other words, something like this (unknown method in human syntax and italics) : -If Range["A1"] text string includes 'thisText' Then- boolVariableName = True End If Is there a built -in way to do this with VBA? I'm sure there is, but I haven't been able to locate the appropriate funtion in the help files, this forum, or via google. Can anyone assist? --- Message posted from http://www.ExcelForum.com/ |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Inserting contents of cell as text into formula using cell referen | AdCook | General Discussion | 3 | June 20th, 2004 11:29 PM |
Keeping text within the cell | Tim Foster | New Users | 5 | June 17th, 2004 07:18 PM |
Referencing data from one cell within the text of another | J.F. | General Discussion | 3 | June 14th, 2004 04:53 PM |
Do you have what it takes... | Frank Kabel | Worksheet Functions | 1 | February 22nd, 2004 08:30 PM |
Is 255 characters in a cell the max? | Mike_S | Setting up and Configuration | 2 | January 24th, 2004 12:43 AM |