Microsoft Office Forums Case Sensitive (contains) Selection

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 07-08-2011, 06:32 AM
apolloman apolloman is offline Case Sensitive (contains) Selection Windows XP Case Sensitive (contains) Selection Office 2007
Novice
Case Sensitive (contains) Selection
 
Join Date: Apr 2011
Posts: 16
apolloman is on a distinguished road
Default 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?
Reply With Quote
  #2  
Old 07-08-2011, 01:14 PM
Colin Legg's Avatar
Colin Legg Colin Legg is offline Case Sensitive (contains) Selection Windows 7 32bit Case Sensitive (contains) Selection Office 2010 32bit
Expert
 
Join Date: Jan 2011
Location: UK
Posts: 369
Colin Legg will become famous soon enough
Default

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)
Reply With Quote
  #3  
Old 07-12-2011, 04:50 AM
apolloman apolloman is offline Case Sensitive (contains) Selection Windows XP Case Sensitive (contains) Selection Office 2007
Novice
Case Sensitive (contains) Selection
 
Join Date: Apr 2011
Posts: 16
apolloman is on a distinguished road
Default

Thanks Colin, I will be testing in my application soon, but it looks like just what I need.
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Case Sensitive (contains) Selection Customer selection in Word Jackissimus Word 2 02-27-2011 12:56 PM
Case Sensitive (contains) Selection 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
Case Sensitive (contains) Selection 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


All times are GMT -7. The time now is 10:23 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2019 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft