Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to restrict a repeating background image in Excel sheet ? wolfhyun Excel Discussion (Misc queries) 2 April 3rd 23 04:33 PM
Updating workbook with an alpha sort sheet and a numeric sort shee cjlatta Excel Discussion (Misc queries) 2 January 28th 09 12:00 AM
Sort sheet based on particuilar sort order Also Excel Worksheet Functions 4 January 3rd 08 09:31 AM
restrict visible cells on a sheet Shaun Excel Discussion (Misc queries) 1 October 23rd 07 12:50 AM
How to restrict the excel sheet containing Chart kvenku[_3_] Excel Programming 2 April 27th 04 02:49 AM


All times are GMT +1. The time now is 04:53 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"