Results 1 to 2 of 2

Macro Code

Threaded View

  1. #1
    Registered User
    Join Date
    02-21-2015
    Location
    Australia
    MS-Off Ver
    365
    Posts
    1

    Macro Code

    Hey all..
    I've got this code protecting my macro button. It works but bypasses and runs through and resets my excel sheet what the macro was built to do. In the case of an incorrect password it should end but doesn't.

    Where did I go wrong? Help is much appreciated..


    Private Sub CommandButton1_Click()
    Dim password As Variant
    password = Application.InputBox("Enter Password", "Password Protected")
    
    Select Case password
        Case Is = False
            'do nothing
        Case Is = "reset"
            Range("A3").Value = "This is secret code"
        Case Else
            MsgBox "Incorrect Password"
    End Select




    Regards Pius
    Last edited by FDibbins; 02-21-2015 at 02:42 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Macro to copy Code / Macro Code / 2 Sheets
    By paxile2k in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-23-2014, 12:59 AM
  2. [SOLVED] Code to create Macro Button and Assigning Macro code
    By rizmomin in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-10-2014, 11:30 AM
  3. Unable to edit macro recording code to be a relative code.
    By holaitsme in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-02-2014, 10:51 AM
  4. [SOLVED] Excel Macro Visual Basic code not looking at all sheets with second section of code.
    By Heinrich Venter in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-10-2014, 08:26 AM
  5. [SOLVED] Code with last column and last row to recognize multiple commands through the macro code
    By kosherboy in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 02-13-2014, 04:10 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