Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Restrict Sort on a Particular Sheet
I have created a sheet with all the numbers at specific
location and i am working on writing a code in VB to find the location of those numbers and Graph it. What i am having trouble is to make is so that nobody can sort that one particular sheet...b/c that could cause all my graphs to mess up... If anybody can help me I'd really appreciate it. Thanks in advance... Sincerely, Ritesh |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Restrict Sort on a Particular Sheet
Hi
Try this two events in the sheet module Ritesh Private Sub Worksheet_Activate() With Application.CommandBars("Standard") .FindControl(ID:=210).Enabled = False .FindControl(ID:=211).Enabled = False End With Application.CommandBars("Worksheet Menu Bar").FindControl _ (ID:=928, Recursive:=True).Enabled = False End Sub Private Sub Worksheet_Deactivate() With Application.CommandBars("Standard") .FindControl(ID:=210).Enabled = True .FindControl(ID:=211).Enabled = True End With Application.CommandBars("Worksheet Menu Bar").FindControl _ (ID:=928, Recursive:=True).Enabled = True End Sub -- Regards Ron de Bruin http://www.rondebruin.nl "Ritesh S" wrote in message ... I have created a sheet with all the numbers at specific location and i am working on writing a code in VB to find the location of those numbers and Graph it. What i am having trouble is to make is so that nobody can sort that one particular sheet...b/c that could cause all my graphs to mess up... If anybody can help me I'd really appreciate it. Thanks in advance... Sincerely, Ritesh |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Restrict Sort on a Particular Sheet
Thank you so much...but I just wanted to clearify your
instructions... Did you want me to put this Code in Sheet(Code) or in a Module... and if you would please tell me what 1st part and 2nd part does Thanks again Sincerely, Ritesh -----Original Message----- Hi Try this two events in the sheet module Ritesh Private Sub Worksheet_Activate() With Application.CommandBars("Standard") .FindControl(ID:=210).Enabled = False .FindControl(ID:=211).Enabled = False End With Application.CommandBars("Worksheet Menu Bar").FindControl _ (ID:=928, Recursive:=True).Enabled = False End Sub Private Sub Worksheet_Deactivate() With Application.CommandBars("Standard") .FindControl(ID:=210).Enabled = True .FindControl(ID:=211).Enabled = True End With Application.CommandBars("Worksheet Menu Bar").FindControl _ (ID:=928, Recursive:=True).Enabled = True End Sub -- Regards Ron de Bruin http://www.rondebruin.nl "Ritesh S" wrote in message ... I have created a sheet with all the numbers at specific location and i am working on writing a code in VB to find the location of those numbers and Graph it. What i am having trouble is to make is so that nobody can sort that one particular sheet...b/c that could cause all my graphs to mess up... If anybody can help me I'd really appreciate it. Thanks in advance... Sincerely, Ritesh . |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Restrict Sort on a Particular Sheet
Hi Ritesh
This are sheet events The code will disable the Sort controls when you activate the worksheet and enabled them when you deacitvate the Sheet Right click on a sheet tab and choose view code Paste the code there Alt-Q to go back to Excel If you copy the events in Sheet2 for example then you can use this events in the ThisWorkbook module to be sure that the controls are working if you go to a other file or save the file It will select a other sheet so the deactivate event will run Right click on the Excel icon next to File in the menubar And choose View code You are now in the Thisworkbook module Paste the Event in this place Alt-Q to go back to Excel Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) ThisWorkbook.Sheets("Sheet1").Activate End Sub Private Sub Workbook_Deactivate() ThisWorkbook.Sheets("Sheet1").Activate End Sub Read Chip Pearson's site about Events http://www.cpearson.com/excel/events.htm -- Regards Ron de Bruin http://www.rondebruin.nl "Ritesh" wrote in message ... Thank you so much...but I just wanted to clearify your instructions... Did you want me to put this Code in Sheet(Code) or in a Module... and if you would please tell me what 1st part and 2nd part does Thanks again Sincerely, Ritesh -----Original Message----- Hi Try this two events in the sheet module Ritesh Private Sub Worksheet_Activate() With Application.CommandBars("Standard") .FindControl(ID:=210).Enabled = False .FindControl(ID:=211).Enabled = False End With Application.CommandBars("Worksheet Menu Bar").FindControl _ (ID:=928, Recursive:=True).Enabled = False End Sub Private Sub Worksheet_Deactivate() With Application.CommandBars("Standard") .FindControl(ID:=210).Enabled = True .FindControl(ID:=211).Enabled = True End With Application.CommandBars("Worksheet Menu Bar").FindControl _ (ID:=928, Recursive:=True).Enabled = True End Sub -- Regards Ron de Bruin http://www.rondebruin.nl "Ritesh S" wrote in message ... I have created a sheet with all the numbers at specific location and i am working on writing a code in VB to find the location of those numbers and Graph it. What i am having trouble is to make is so that nobody can sort that one particular sheet...b/c that could cause all my graphs to mess up... If anybody can help me I'd really appreciate it. Thanks in advance... Sincerely, Ritesh . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to restrict a repeating background image in Excel sheet ? | Excel Discussion (Misc queries) | |||
Updating workbook with an alpha sort sheet and a numeric sort shee | Excel Discussion (Misc queries) | |||
Sort sheet based on particuilar sort order | Excel Worksheet Functions | |||
restrict visible cells on a sheet | Excel Discussion (Misc queries) | |||
How to restrict the excel sheet containing Chart | Excel Programming |