+ Reply to Thread
Results 1 to 9 of 9

lower or upper case password

  1. #1
    Forum Contributor
    Join Date
    10-24-2012
    Location
    San Diego, USA
    MS-Off Ver
    Excel 2019
    Posts
    871

    lower or upper case password

    I have the below code, it works fine, but if someone can help me change it to use upper case letters or lower case letter for password please, here is the code
    Please Login or Register  to view this content.

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: lower or upper case password

    Just replace this line in both the places.

    Please Login or Register  to view this content.
    With

    Please Login or Register  to view this content.


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  3. #3
    Forum Contributor
    Join Date
    10-24-2012
    Location
    San Diego, USA
    MS-Off Ver
    Excel 2019
    Posts
    871

    Re: lower or upper case password

    It worked for the first sub, but for the second sub, I got the debugger pop up highlighting the below line:
    Please Login or Register  to view this content.

  4. #4
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MSO Home and Business 2024
    Posts
    7,292

    Re: lower or upper case password

    How about this ?

    Please Login or Register  to view this content.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  5. #5
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: lower or upper case password

    Quote Originally Posted by bakerman2 View Post
    ThisWorkbook.Unprotect LCase(pwd)
    ThisWorkbook.Sheets("Inventory").Unprotect LCase(pwd)[/CODE]
    Should be Ucase() I think

  6. #6
    Forum Contributor
    Join Date
    10-24-2012
    Location
    San Diego, USA
    MS-Off Ver
    Excel 2019
    Posts
    871

    Re: lower or upper case password

    THAT WORKED! thank you bakerman2 and Sixthsense both of you. Rep added and thread will be marked solved.
    Bakerman2 could you explain why I need to add the 'LCase' , why was it necessary to add that in my macro?

  7. #7
    Forum Contributor
    Join Date
    10-24-2012
    Location
    San Diego, USA
    MS-Off Ver
    Excel 2019
    Posts
    871

    Re: lower or upper case password

    i tried it "UCase()" it don't work, but it worked with "LCase", thank you both !!

  8. #8
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,212

    Re: lower or upper case password

    The original password playtoy2 is lowercase hence it needs to be lower case when presented

    Please Login or Register  to view this content.
    could be replaced with
    Please Login or Register  to view this content.

  9. #9
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MSO Home and Business 2024
    Posts
    7,292

    Re: lower or upper case password

    Thanks for rep+. Much appreciated.

    davsth has given you the short version, I'll present the long one.

    When using this
    Please Login or Register  to view this content.
    you can enter the password in uppercase or lowercase in the userform. They will both be converted to uppercase (temporarily) when performing the check.
    But pwd will hold exactly what you've entered in the userform.
    Suppose you have set the sheet password in lowercase and pwd is uppercase in userform there's a difference so we convert the userform value to lowercase to match sheet password.

+ 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. Replies: 1
    Last Post: 07-14-2016, 05:51 AM
  2. Replies: 7
    Last Post: 04-18-2014, 04:11 PM
  3. [SOLVED] Lower Case to Upper Case but No Auto Correction : Solved by Mod (6StringJazzer)
    By HaroonSid in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-27-2014, 10:44 AM
  4. [SOLVED] Convert 1st letter of word to Upper Case and rest to lower case
    By rizmomin in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 05-23-2013, 11:44 AM
  5. Replies: 2
    Last Post: 12-09-2005, 05:15 AM
  6. [SOLVED] Changing file in all upper case to upper and lower case
    By Sagit in forum Excel General
    Replies: 14
    Last Post: 08-25-2005, 10:05 PM
  7. Replies: 1
    Last Post: 03-09-2005, 05:06 PM

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