PDA

View Full Version : [SOLVED:] Open passworded sheet from other sheet in workbook



thekneeguy
10-06-2005, 06:32 AM
Hello

I have two worksheets in an excel progam (2002). What I would like is this but I am not sure how to do all of this at once.

I would like the first sheet ""sheet 1" to be visibe on opening the program. This is a sort of splash page which provides updates to products, discontinued items, etc. From this page, the user may opt to view a tutorial video which explains the program. (This part works fine.) Or the user may opt to bypass the turorial and click a second command button which would activate a user sign on (a user form with an input box for a password which customizes some of the information based on the entry and then the second "inventory" sheet becomes visible. The user form with the password is working as well. I just really know how to

1) make sheet 1 be the default for onopen and

2) have the command button on sheet 1 execute the signon form and then show the inventory sheet.

I hope someone can help with this. I think maybe I am confusin some of the steps.

Thank you

onlyadrafter
10-06-2005, 06:53 AM
Hello,

To have Sheet1 displayed when opening the workbook, in the VB window, inthe THIS_WORKBOOK module, copy this code


Private Sub Workbook_Open()
Sheets("Sheet1").Activate
End Sub

DOn't fully understand 2)

have you got USERFORM1.show in the code for the button?

onlyadrafter
10-06-2005, 07:01 AM
Hello again, having re-read, how about this

The userform has a command button

in the USERFORM have this code


Private Sub CommandButton1_Click()
If TextBox1.Text <> "PASSWORD" Then
MY_ENTRY = MsgBox("INCORRECT PASSWORD", vbOKOnly, "ERROR")
End If
Sheets("Sheet2").Visible = True
Sheets("SHEET2").Activate
UserForm1.Hide
End Sub

and in a Module


Sub get_password()
UserForm1.Show
End Sub


assign this code to the command button on sheet 1

thekneeguy
10-06-2005, 08:55 AM
Thank you very very much this works perfectly!!!!!!!!!!!! Thank you thank you!