By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,557 Members | 1,164 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,557 IT Pros & Developers. It's quick & easy.

Back Button in excel

P: 9
when a user logs in it will store there security level in a public variable called level. im trying to use this so that i can create a back button to instead of going back the login screen it will go back to the users switchboard. but the code doesnt seem to be reading from the variable.
heres the code of the back

Private Sub back_Click()
If level = low Then
Worksheets("Lowlev").Visible = True
End If
If level = Mid Then
Worksheets("MidLevel").Visible = True
End If
If level = high Then
Worksheets("HighLevel").Visible = True
End If
Exit Sub
End Sub

i would be very thankful for anyones help
Nov 24 '06 #1
Share this Question
Share on Google+
1 Reply

P: 267
i would be very thankful for anyones help[/quote]

i should do this differently use Case instead

Private Sub back_Click()
Select Case Level
Case is = low
Worksheets("Lowlev").Visible = True
Case is = medium
Worksheets("Mediumlev").Visible = True
Case is= high
Worksheets("Highlev").Visible = True
End Select
End Sub

declare the variables Level, Low, Medium and High in your general declaration if you want them to be available in your form, or in a module if you want them in the entire project.
Nov 24 '06 #2

Post your reply

Sign in to post your reply or Sign up for a free account.