Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 60
Default CONTAINS SPECIFIC TEXT OR NUMBER

Is there a way to test a cell for a specific text or number? Lets say a cell
contents of cell A1 begins with the word <Check, how would I test for that?

--
D.S.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default CONTAINS SPECIFIC TEXT OR NUMBER

One way:

Dim bCheck As Boolean
bCheck = Range("A1").Text Like "Check*"

another:

Dim bCheck As Boolean
bCheck = Left(Range("A1").Text, 5) = "Check"

note these are case sensitive. To make them case insensitive, you can do
something like:

Dim bCheck As Boolean
bCheck = UCase(Range("A1").Text) Like "CHECK*"


In article ,
"D.S." wrote:

Is there a way to test a cell for a specific text or number? Lets say a cell
contents of cell A1 begins with the word <Check, how would I test for that?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 60
Default CONTAINS SPECIFIC TEXT OR NUMBER

Thank you, I knew about the 'Left' function, I knew there was another and
couldn't remember what it was. Kept thinking it was some like 'contains'.

'Like' should work splendidly. Thanks again


"JE McGimpsey" wrote in message
...
One way:

Dim bCheck As Boolean
bCheck = Range("A1").Text Like "Check*"

another:

Dim bCheck As Boolean
bCheck = Left(Range("A1").Text, 5) = "Check"

note these are case sensitive. To make them case insensitive, you can do
something like:

Dim bCheck As Boolean
bCheck = UCase(Range("A1").Text) Like "CHECK*"


In article ,
"D.S." wrote:

Is there a way to test a cell for a specific text or number? Lets say a

cell
contents of cell A1 begins with the word <Check, how would I test for

that?


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 for number after specific text in string AMH Excel Worksheet Functions 8 September 4th 09 03:05 PM
How can I replace text with a specific number? Emma O''Shaughnessy Excel Discussion (Misc queries) 3 July 3rd 08 12:14 PM
Need to display a number when a specific text is entered Desperate Excel Discussion (Misc queries) 3 December 31st 07 06:03 AM
Count number of text values in a specific row Carlee Excel Worksheet Functions 3 June 7th 07 11:47 PM
Convert specific text to a corresponding number slh Excel Discussion (Misc queries) 7 May 18th 05 10:47 AM


All times are GMT +1. The time now is 11:14 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"