467,879 Members | 1,090 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,879 developers. It's quick & easy.

Back Button in excel

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
Worksheets("Lowlev").Select
End If
If level = Mid Then
Worksheets("MidLevel").Visible = True
Worksheets("MidLevel").Select
End If
If level = high Then
Worksheets("HighLevel").Visible = True
Worksheets("HighLevel").Select
End If
Exit Sub
End Sub

i would be very thankful for anyones help
Nov 24 '06 #1
  • viewed: 1934
Share:
1 Reply
100+
i would be very thankful for anyones help[/quote]

hi
i should do this differently use Case instead

Private Sub back_Click()
Select Case Level
Case is = low
Worksheets("Lowlev").Visible = True
Worksheets("Lowlev").Select
Case is = medium
Worksheets("Mediumlev").Visible = True
Worksheets("Mediumlev").Select
Case is= high
Worksheets("Highlev").Visible = True
Worksheets("Highlev").Select
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.

Similar topics

25 posts views Thread by KK | last post: by
8 posts views Thread by DC Gringo | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.