PC Review


Reply
Thread Tools Rate Thread

Case Specific

 
 
kirkm
Guest
Posts: n/a
 
      14th Apr 2009
? 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 With Quote
 
 
 
 
Per Jessen
Guest
Posts: n/a
 
      14th Apr 2009
Try this:

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

Hopes this heps.

---
Per

"kirkm" skrev i meddelelsen
news(E-Mail Removed)...
>? 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 With Quote
 
Mike H
Guest
Posts: n/a
 
      14th Apr 2009
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
>

 
Reply With Quote
 
Jacob Skaria
Guest
Posts: n/a
 
      14th Apr 2009
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 With Quote
 
Mike H
Guest
Posts: n/a
 
      14th Apr 2009
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 With Quote
 
kirkm
Guest
Posts: n/a
 
      14th Apr 2009

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

Cheers - Kirk
 
Reply With Quote
 
Rick Rothstein
Guest
Posts: n/a
 
      14th Apr 2009
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" <(E-Mail Removed)> wrote in message
news:E9519CBB-95B3-40CD-B2FD-(E-Mail Removed)...
> 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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Find a specific case Patrick Microsoft Access VBA Modules 8 12th May 2009 12:30 AM
Find a specific case Patrick Microsoft Access VBA Modules 0 10th May 2009 09:39 AM
BHO Hangs IE in a specific case =?Utf-8?B?S3VtYXI=?= Windows XP Internet Explorer 1 4th Oct 2005 11:51 AM
non case specific mike allen Microsoft Excel Programming 4 21st Jan 2005 07:46 PM
I get a error message at start-up..."WJviewer Error, Could not execute main, the system cannot find the file specific" I also am getting N-CASE ALERT, RE-INSTALL N-CASE, IS THIS OK TO DO? mike lord Windows XP Accessibility 1 4th Jan 2004 12:50 AM


Features
 

Advertising
 

Newsgroups
 


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