Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
dan dan is offline
external usenet poster
 
Posts: 866
Default Deny/Allow for certain range.

Hello everyone,

I have a question and I hope to get an answer. I use a Excel spreadsheet and
I need to set it up the way that only specific range in the sheet can be used
as an active. There is range such as B1:C20, so whenever mouse is being
clicked out of that range it should not select any other cell, except for
those in the specified range. How can that be accomplished?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 303
Default Deny/Allow for certain range.

one way


enter the code below into the worksheet selection change
note ..........top and bottom lines are already there

method to get there

right click onto the sheet tab
select view code
select worksheet in the dropdown box which shows "general"
select selectionchange in the righthand dropdown box

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim Action_Range As Range
Set Action_Range = Range("B1:C20")

Dim Current_Range As Range
Set Current_Range = ActiveCell


If Intersect(Current_Range, Action_Range) Is Nothing Then

Range("B1").Select
Beep
MsgBox "You need to select within B1 to C20", vbInformation

End If
End Sub

--
Greetings from New Zealand

"Dan" wrote in message
...
Hello everyone,

I have a question and I hope to get an answer. I use a Excel spreadsheet
and
I need to set it up the way that only specific range in the sheet can be
used
as an active. There is range such as B1:C20, so whenever mouse is being
clicked out of that range it should not select any other cell, except for
those in the specified range. How can that be accomplished?



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Deny/Allow for certain range.

You can do this by applying sheet protection

Select the *entire* sheet by clicking the little square immediately to the
left of column A and immediately above row 1.

Goto the menu FormatCellsProtection tabLockedOK
Select the range of cells that you want to allow access to B1:C20
Goto the menu FormatCellsProtection tabuncheck LockedOK
Now, set the sheet protection:
Goto the menu ToolsProtectionProtect sheet
You'll see various options available to you. Since you don't want users to
be able to select cells outside of the range B1:C20 uuncheck the option:
Select locked cells and check the option: Select unlocked cells

OK out

--
Biff
Microsoft Excel MVP


"Dan" wrote in message
...
Hello everyone,

I have a question and I hope to get an answer. I use a Excel spreadsheet
and
I need to set it up the way that only specific range in the sheet can be
used
as an active. There is range such as B1:C20, so whenever mouse is being
clicked out of that range it should not select any other cell, except for
those in the specified range. How can that be accomplished?



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
deny printing for certain blank cells huntnpeck2 Excel Worksheet Functions 2 October 3rd 07 04:57 PM
Excel Addin:Setting the range to the Excel.Range object range prop Rp007 Excel Worksheet Functions 5 November 24th 06 04:30 PM
formula to sort a range so that it matches the exact rows of a column that is outside that range? steveo Excel Discussion (Misc queries) 1 June 18th 06 02:05 AM
How do I deny opening and viewing any file to any user and lock i. Leah Wright Excel Discussion (Misc queries) 1 April 22nd 05 11:59 PM
Deny file access if user declines macros? [email protected] Excel Discussion (Misc queries) 3 February 7th 05 03:02 PM


All times are GMT +1. The time now is 07:58 AM.

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"