Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Prevent Users from switching worksheet
Here is my goal. I have a form which is non modal so that users can
select cells from a chosen worksheet. Users should only be able to chose cells from that worksheet. Therefore I want to take away the ability to change worksheets while that form is displayed. What I have tried. I figured maybe I could disable the tabs... Application.CommandBars("Workbook tabs").Enabled = false But this seems to have no affect on anything. So I resorted to hiding all of the other worksheets during the form, and redisplaying them after. Is there another way? Should I be able to disable the tabs? Thanks. Please also kindly respond to my private email if you can. -Ew |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Prevent Users from switching worksheet
The following code will hide the worksheet tabs from the user. I do not know if this is sufficient to solve your proble
ActiveWindow.DisplayWorkbookTabs = False |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Prevent Users from switching worksheet
Hello Elie
Maybe this is what you need. Right-click on the required sheet, choose "view code " and then copy and paste the code below. You will need to change Sheet1 with the name of your sheet and UserForm1 with the name of your userform. What it does it to re-activate your sheet whenever it is deactivated while your userform is loaded. Take note that the userform must be "unloaded" in order for the user to select other sheet. Private Sub Worksheet_Deactivate() For Each frm In UserForms If frm.Name = "UserForm1" Then ActiveWorkbook.Sheets("Sheet1").Activate Next frm End Sub Hope this help. Jon-jon "Elie" wrote in message om... Here is my goal. I have a form which is non modal so that users can select cells from a chosen worksheet. Users should only be able to chose cells from that worksheet. Therefore I want to take away the ability to change worksheets while that form is displayed. What I have tried. I figured maybe I could disable the tabs... Application.CommandBars("Workbook tabs").Enabled = false But this seems to have no affect on anything. So I resorted to hiding all of the other worksheets during the form, and redisplaying them after. Is there another way? Should I be able to disable the tabs? Thanks. Please also kindly respond to my private email if you can. -Ew |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Prevent Users from switching worksheet
ActiveWindow.DisplayWorkbookTabs = False
John M. Thanks. It does just what I want. Hides the tabs. Why do you think it may not be sufficient. -Elie |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Prevent Users from switching worksheet
Hello Elie,
Any average user know that you can switch between sheets by ctrl+pageup and ctrl+pagedown. Have you red my reply to your post? Regards, "Elie" wrote in message om... ActiveWindow.DisplayWorkbookTabs = False John M. Thanks. It does just what I want. Hides the tabs. Why do you think it may not be sufficient. -Elie |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Prevent Users from switching worksheet
Jon Jon,
Thanks. I did see your reply. I am advanced in some parts of excel but still rather novice in many things. This is my first major excel project so please bare with me. I think that your first solution will work for me (well, similar anyway because I didn't describe my requirements that accurately). Thanks, Elie. "JON JON" wrote in message ... Hello Elie, Any average user know that you can switch between sheets by ctrl+pageup and ctrl+pagedown. Have you red my reply to your post? Regards, "Elie" wrote in message om... ActiveWindow.DisplayWorkbookTabs = False John M. Thanks. It does just what I want. Hides the tabs. Why do you think it may not be sufficient. -Elie |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Prevent wandering users | Excel Discussion (Misc queries) | |||
How do I prevent users to delete a worksheet, but allow to edit? | Excel Discussion (Misc queries) | |||
prevent users from overwriting other users data | Excel Worksheet Functions | |||
MACRO OR VBA CODE TO PREVENT USERS FROM PRINTING THE CONTENTS OF A WORKSHEET? | Excel Programming | |||
Prevent users from using AutoFilter | Excel Programming |