A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

[vba-newbie] testing cell text for specific characters?



 
 
Thread Tools Display Modes
  #1  
Old August 21st, 2004, 03:26 AM
counterform
external usenet poster
 
Posts: n/a
Default [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  
Old August 21st, 2004, 06:56 AM
JE McGimpsey
external usenet poster
 
Posts: n/a
Default

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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

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


All times are GMT +1. The time now is 09:51 PM.


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