+ Reply to Thread
Results 1 to 2 of 2

Inputbox when selecting a cell

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    06-25-2012
    Location
    Porto, Portugal
    MS-Off Ver
    Excel 2010
    Posts
    201

    Inputbox when selecting a cell

    Hi... i'm trying to create a file where a user inputs a password and based on a VLOOKUP formula a username appears in a specific cell after user press OK.

    Currently i have this:
    Sub PASS()
    
    MyInput = InputBox("Please input your user password")
    MsgBox ("Code Accepted!")
    Range("I14").Value = MyInput
    End Sub
    The thing is that if i press CANCEL button here it will show the same msgbox and i would like it to show nothing, just cancel.
    Then i would also like it to verify if the input value is any of the one's in the range, and if it is then it would say: "Code Accepted", otherwise "Code not Accepted. Please try again". And the box still remain with blank value so the user inputs a value again.
    Also i would like this bok to appear just from selecting a specific cell, in this example cell I12. Currently i have to call this macro through a button or image and not by selecting the cell.

    I added an attached file so you can understand better what i need.

    Thanks for the help in advanced.
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    06-25-2012
    Location
    Porto, Portugal
    MS-Off Ver
    Excel 2010
    Posts
    201

    Re: Inputbox when selecting a cell

    About call the inputbox when cell is selected i already fixed it by using the following code in the sheet code:
    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
        
        If Target.Address = "$I$12" Then
            Application.Run ("PASS")
        End If
        
    End Sub
    Now the problem is all about the inputbox.
    I would like it to show a message "Code accepted" if it was equal to any of the ones in the list i have in a range of cells. And if was not show another message like "This code does not exist. Please try again."

    Someone can help please?

+ 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. Inputbox button control + msgbox for empty inputbox
    By D_Rennie in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-30-2009, 12:39 PM
  2. Selecting cells via the inputbox
    By naffets77 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-20-2007, 02:12 PM
  3. selecting print area via inputbox
    By Mary in forum Excel General
    Replies: 1
    Last Post: 08-14-2006, 01:20 PM
  4. [SOLVED] Selecting a Range using Inputbox Method
    By John Pierce in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-04-2005, 08:05 AM
  5. Selecting a range with an inputbox...
    By Rutgers_Excels in forum Excel General
    Replies: 0
    Last Post: 04-08-2005, 03:25 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