View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Bill Kuunders Bill Kuunders is offline
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?