Results 1 to 2 of 2
  1. #1
    3 Star Lounger
    Join Date
    Dec 2006
    Posts
    250
    Thanks
    0
    Thanked 0 Times in 0 Posts

    displaying input box to hide sheet (2003)

    Hello,

    I have created the following code that I need some help with.

    Private Sub Worksheet_Activate()

    Password = InputBox("Enter Password")
    If Password = "test" Then
    Range("a1").Select
    ElseIf Password (is not equal to) "test" Then
    goto Worksheets("INPUTSHEET")
    .Visible = xlSheetVisible
    .Select
    End With
    end if
    end sub

    Basically I want the user to put in a password and if it is not "test" then go back to the worksheet("INPUTSHEET"). I don't know what the command for is not equal is in VBA or how to get the user back to the worksheet ("INPUTSHEET"). I forgot to mention, the ("INPUTSHEET") will be hidden at first so I need to unhide it.Any help would be great.

  2. #2
    5 Star Lounger
    Join Date
    Aug 2004
    Location
    Connecticut, USA
    Posts
    816
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: displaying input box to hide sheet (2003)

    Not equal in VBA would be <>.

    Try this one.


    Private Sub Worksheet_Activate()

    Dim Password As String

    Password = InputBox("Enter Password")
    If Password = "test" Then
    Range("a1").Select
    Else
    Worksheets("INPUTSHEET").Visible = True
    Worksheets("INPUTSHEET").Select
    End If

    End Sub

Posting Permissions

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