View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Ken Ken is offline
external usenet poster
 
Posts: 207
Default Unhide Worksheet with Login UserForm

Ryan

I think it should just be

Workbooks("CALCULATOR 11-5-2007.xls").Worksheets.Visible = True

Good luck.

Ken
Norfolk, Va


On Jan 4, 11:11*am, RyanH wrote:
I have a UserForm that is shown when I open a workbook. *The UserForm has a
UserName ComboBox, Password TextBox, Login CommandButton, and a Cancel
CommandButton. *I only want .Sheets("QUOTE") to Unhide when this particular
user clicks the Login button, how do I do that? *This is what I got so far,
but I am getting an Error.

Note: *I don't know if this helps but I use this code to Hide all the
worksheets, when I close the workbook.

Private Sub Workbook_BeforeClose(Cancel As Boolean)

* * Windows("CALCULATOR 11-5-2007.xls").Visible = False

End Sub

Private Sub cmbLogin_Click()

Select Case
* * Case "Peter Maida"
* * * * If tbxPassword = "peterm2" Then
* * * * * * Workbooks("CALCULATOR 11-5-2007.xls").Worksheets.Visible =
xlSheetHidden * * *'<===ERROR ERROR
* * * * * * Sheets("QUOTE").Visible = xlSheetVisible
* * * * * * With Sheets("QUOTE")
* * * * * * * * .Unprotect Password:="AdTech"
* * * * * * * * .Range("F3").Value = "Peter Maida *Ext.. 208"
* * * * * * * * .Range("F4").Value = "E-mail: "
* * * * * * * * .Protect Password:="AdTech"
* * * * * * End With
* * * * * * Unload Me
* * * * * * Exit Sub
* * * * Else
* * * * * * MsgBox "Try agian.", vbCritical
* * * * * * With tbxPassword
* * * * * * * * .Value = ""
* * * * * * * * .SetFocus
* * * * * * End With
* * * * End If
End Select

End Sub