#1
|
|||
|
|||
Case Sensitive (contains) Selection
I am comparing two cells. For example lets say the first cell A1, contains the following: MW tt EC. Lets say the cell I am comparing it with, B1, contains: mw. The upper and lower case have different meanings in my work sheets. I want to do a case sensitive selection, selecting B1 if A1 contains B1. In the example I gave the formula should not select B1 since lower case mw is not contained in A1. "Exact" seems to be used for
differentiating between upper and lower case, but I can't figure out if its use is possible when the cell may contain other characters as well. I would appreciate it if someone could give me a hand with this? |
#2
|
||||
|
||||
Is this comparision within a worksheet formula, or in VBA? I'll assume the former...
Excel has a few string functions which perform this sort of comparision, of which two prime candidates are SEARCH() and FIND(). FIND() is the case sensitive function of the pair, so will suit your needs perfectly. This formula returns the value in B1 if B1 is contained in A1; else it returns the value in A1. =IF(ISNUMBER(FIND(B1,A1)),B1,A1) |
#3
|
|||
|
|||
Thanks Colin, I will be testing in my application soon, but it looks like just what I need.
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Customer selection in Word | Jackissimus | Word | 2 | 02-27-2011 12:56 PM |
Save Selection | cksm4 | Word VBA | 25 | 01-30-2011 11:44 PM |
Search for paras beginging with a lower case | MShroff | Word | 1 | 10-19-2010 06:41 AM |
From all UPPER CASE to Proper Case | davers | Word | 1 | 04-30-2009 12:41 PM |
Upper to lower case | jd | Excel | 1 | 04-28-2006 07:40 AM |