Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 166
Default Case Specific

? instr("enough tables and Chairs to seat 236", "chairs")

This returns 0 because I'm not using a capital "C" in chairs

Is there a command to cause Excel to be non case-specific ?

Thanks - Kirk
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,533
Default Case Specific

Try this:

instr(LCase("enough tables and Chairs to seat 236"), "chairs")

Hopes this heps.

---
Per

"kirkm" skrev i meddelelsen
...
? instr("enough tables and Chairs to seat 236", "chairs")

This returns 0 because I'm not using a capital "C" in chairs

Is there a command to cause Excel to be non case-specific ?

Thanks - Kirk


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Case Specific

Try this

InStr(1, "enough tables and Chairs to seat 236", "chairs", 1)

Mike

"kirkm" wrote:

? instr("enough tables and Chairs to seat 236", "chairs")

This returns 0 because I'm not using a capital "C" in chairs

Is there a command to cause Excel to be non case-specific ?

Thanks - Kirk

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default Case Specific

Convert the text string and search string to the same case and then use Instr.

Lcase() for lower case
Ucase() for upper case

If this post helps click Yes
---------------
Jacob Skaria


"kirkm" wrote:

? instr("enough tables and Chairs to seat 236", "chairs")

This returns 0 because I'm not using a capital "C" in chairs

Is there a command to cause Excel to be non case-specific ?

Thanks - Kirk

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Case Specific

Jacob,

You don't need to do that with instr, you can use the optional switch of 1
(VBTextCompare) and it ignores case. If you use the switch you have to
specify the other optional start character.

Mike

"Jacob Skaria" wrote:

Convert the text string and search string to the same case and then use Instr.

Lcase() for lower case
Ucase() for upper case

If this post helps click Yes
---------------
Jacob Skaria


"kirkm" wrote:

? instr("enough tables and Chairs to seat 236", "chairs")

This returns 0 because I'm not using a capital "C" in chairs

Is there a command to cause Excel to be non case-specific ?

Thanks - Kirk



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 166
Default Case Specific


Thanks everyone. Figured it all out and learned something new.

Cheers - Kirk
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Case Specific

Actually, I like using the built-in constant names rather than their
numerical equivalents (I find that makes the code more self-documenting)...

InStr(1, "enough tables and Chairs to seat 236", "chairs", vbTextCompare)

--
Rick (MVP - Excel)


"Mike H" wrote in message
...
Jacob,

You don't need to do that with instr, you can use the optional switch of 1
(VBTextCompare) and it ignores case. If you use the switch you have to
specify the other optional start character.

Mike

"Jacob Skaria" wrote:

Convert the text string and search string to the same case and then use
Instr.

Lcase() for lower case
Ucase() for upper case

If this post helps click Yes
---------------
Jacob Skaria


"kirkm" wrote:

? instr("enough tables and Chairs to seat 236", "chairs")

This returns 0 because I'm not using a capital "C" in chairs

Is there a command to cause Excel to be non case-specific ?

Thanks - Kirk


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
Data Validation from a list - Always case specific? Kevin Excel Discussion (Misc queries) 2 December 21st 07 09:35 PM
Searching for case specific data Colin Foster Excel Discussion (Misc queries) 4 October 9th 07 06:10 PM
Searching for specific case okrob Excel Programming 3 February 4th 07 01:59 AM
Case specific LOOKUP alternative dan Excel Discussion (Misc queries) 4 June 5th 06 12:22 PM
non case specific mike allen[_2_] Excel Programming 4 January 21st 05 07:46 PM


All times are GMT +1. The time now is 06:08 AM.

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"