View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Simon Lloyd[_990_] Simon Lloyd[_990_] is offline
external usenet poster
 
Posts: 1
Default how to make the content in an excel cell read only?!


Here's just a quick sample, put it in the code module for the worksheet:

Code:
--------------------
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Intersect(Target, Range("A1:A10,B2,C5:D10")) Is Nothing Then
MsgBox "You cannot select that cell!, you will now be moved to the next cell to the right!" _
, vbOKOnly, "Invalid Cell Choice"
ActiveCell.Offset(0, 1).Select
End If
End Sub
--------------------


Simon Lloyd;190156 Wrote:
The same applies!, either that or specifically name them in an intersect
range, and make it so that cell cannot be selected, but of course if you
are doing that macro's have to be enabled!



--
Simon Lloyd

Regards,
Simon Lloyd
'The Code Cage' (http://www.thecodecage.com)
------------------------------------------------------------------------
Simon Lloyd's Profile: http://www.thecodecage.com/forumz/member.php?userid=1
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=52319