+ Reply to Thread
Results 1 to 13 of 13

Introduce a non-case sensitive command?

  1. #1
    Forum Contributor
    Join Date
    07-05-2016
    Location
    cardiff
    MS-Off Ver
    2010
    Posts
    787

    Introduce a non-case sensitive command?

    Morning All,

    I'd like to make this statement non case sensitive, so it makes no difference whether the 'C' is Capital or otherwise:

    Please Login or Register  to view this content.

    Any ideas?

  2. #2
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,231

    Re: Introduce a non-case sensitive command?

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Last edited by sintek; 05-02-2017 at 04:11 AM. Reason: Code tags
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  3. #3
    Forum Expert
    Join Date
    06-09-2010
    Location
    Australia
    MS-Off Ver
    Excel 2013
    Posts
    1,714

    Re: Introduce a non-case sensitive command?

    or try this:

    Please Login or Register  to view this content.

  4. #4
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Introduce a non-case sensitive command?

    @sintek
    Should it not be?
    If Ucase(?) = "C69336"
    Click *Add Reputation to thank those who helped you. Ask if anything is not clear

  5. #5
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,231

    Re: Introduce a non-case sensitive command?

    @ kev_ To be or not to be...Right you are...
    So like such?
    Please Login or Register  to view this content.
    Last edited by sintek; 05-02-2017 at 04:12 AM.

  6. #6
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Introduce a non-case sensitive command?

    No real benefit to Ucase("C69336") since it's already in upper case.
    Don
    Please remember to mark your thread 'Solved' when appropriate.

  7. #7
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Introduce a non-case sensitive command?

    @sintek
    "C69336" is already upper case - so it does not require wrapping in Ucase function - it is not incorrect, just unnecessary
    If Ucase(Textbox1) = "C69936" ....
    Is same test as
    If Lcase(Textbox1) = "c69936" ....

  8. #8
    Forum Contributor
    Join Date
    07-05-2016
    Location
    cardiff
    MS-Off Ver
    2010
    Posts
    787

    Re: Introduce a non-case sensitive command?

    Thanks All,

    I've pasted 'Option Compare Text' at the top of my user Forms, of which there is 7, which works great. It's obviously better to paste it into a module which will then affect all the user forms?
    However, I have 5 modules, does it make a difference which one I paste it into? Or should I take all the information from the modules and paste them into 1 module?

    Cheers

  9. #9
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,231

    Re: Introduce a non-case sensitive command?

    @ kev_ & xlnitwit
    Of course...Thanks

  10. #10
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Introduce a non-case sensitive command?

    Quote Originally Posted by bralew View Post
    I've pasted 'Option Compare Text' at the top of my user Forms, of which there is 7, which works great. It's obviously better to paste it into a module which will then affect all the user forms?
    Option statements only apply to the module they are in, so you would require it in each one. It's more efficient to use LCase$ or UCase$, though I doubt you'll notice the difference in practical terms unless you are performing millions of comparisons.

  11. #11
    Forum Contributor
    Join Date
    07-05-2016
    Location
    cardiff
    MS-Off Ver
    2010
    Posts
    787

    Re: Introduce a non-case sensitive command?

    Thanks xlnitwit. I've read that a module has a 64K limit although this is questioned by some users. Should I put my code into a generic module rather than have them spread out?

    What do you prefer?

  12. #12
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Introduce a non-case sensitive command?

    A module does indeed have a limit of about 64K. Personally I have never got near that limit.

    My preference is to group related procedures in the same module and keep common functions (those which are called from many other routines) in their own separate module(s).

  13. #13
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Introduce a non-case sensitive command?

    Try this.
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Case Sensitive
    By drew.parker in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-30-2016, 11:32 AM
  2. [SOLVED] SUMPRODUCT Or SUMIF - In case of Case sensitive???
    By lifeisaspreadsheet in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 10-28-2012, 07:57 AM
  3. Case sensitive sorting
    By hmmmmm in forum Excel General
    Replies: 15
    Last Post: 06-12-2009, 02:48 AM
  4. excel exact command should not be case sensitive
    By keabu in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-17-2006, 01:15 AM
  5. [SOLVED] Case Sensitive w/ IF
    By jeffP in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 02-05-2006, 09:20 PM
  6. .Name case sensitive
    By CinqueTerra in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-16-2006, 05:00 PM
  7. Case Sensitive
    By hemants in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-09-2005, 04:20 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1