Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 57
Default how to make the content in an excel cell read only?!


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default how to make the content in an excel cell read only?!


*how to make the content in an excel cell read only?!* Firstly you have to make sure the cells attributes are locked (right

click, format cells, protection) they are locked by default, then
protect the sheet, the cell can then only be read not edited. To be
honest you need to explain more what you want to do!


--
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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 57
Default how to make the content in an excel cell read only?!

well, am actually working with c# and developing an excel addin. I need to
make some excel cells, having some text, read-only and the rest of the sheet
is free to any modifications by the user.

Regards.

"Simon Lloyd" wrote:


*how to make the content in an excel cell read only?!* Firstly you have to make sure the cells attributes are locked (right

click, format cells, protection) they are locked by default, then
protect the sheet, the cell can then only be read not edited. To be
honest you need to explain more what you want to do!


--
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


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default how to make the content in an excel cell read only?!


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!

NA_AB;189924 Wrote:
well, am actually working with c# and developing an excel addin. I need
to
make some excel cells, having some text, read-only and the rest of the
sheet
is free to any modifications by the user.

Regards.

"Simon Lloyd" wrote:


*how to make the content in an excel cell read only?!* Firstly you

have to make sure the cells attributes are locked (right
click, format cells, protection) they are locked by default, then
protect the sheet, the cell can then only be read not edited. To be
honest you need to explain more what you want to do!


--
Simon Lloyd

Regards,
Simon Lloyd
'The Code Cage' ('The Code Cage' (http://www.thecodecage.com))

------------------------------------------------------------------------
Simon Lloyd's Profile: 'The Code Cage Forums - View Profile: Simon

Lloyd' (http://www.thecodecage.com/forumz/member.php?userid=1)
View this thread: 'how to make the content in an excel cell read

only?! - The Code Cage Forums'
(http://www.thecodecage.com/forumz/sh...ad.php?t=52319)




--
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

  #5   Report Post  
Posted to microsoft.public.excel.programming
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



  #6   Report Post  
Posted to microsoft.public.excel.programming
dm dm is offline
external usenet poster
 
Posts: 23
Default Use Data Validation

Select Cell
Data - Validation - Setttings - Validation Criteria - Select "Custom" -
in Formula enter "=" (equal sign)
That's it. Excel will not allow you to change value

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 57
Default Use Data Validation

hey sorry ppl but i would appreciate if i can be provided with a simple code
which may be appear like, ((Range)myapp.cells[r,c]).isreadonly() or something
like that, cuz there are many different cells that i would want to make read
only and many others editable(read n write). And simon, truly speaking, i do
not want to transfer user control to any other cell. Am basically building an
excel com add-in using visual studio and c#.net tech. I can access a range of
cell/ cells in my current application's active sheet and in this sheet i
should be able to make some cells read only dynamically and later should also
be able to remove the constraint(read only) on the cells of my choice.

i see that many things can be done in vb but i am not able to convert or
find similar functionalities in c#, so please provide me with the code in
c#...

Regards,
na_ab
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 can I make a cell content equal the tab name 'sheet1' ? balder Excel Worksheet Functions 13 April 2nd 23 07:22 PM
Make a cell content not printable basilio Excel Worksheet Functions 1 November 27th 09 12:01 PM
How make hyperlink refer to cell content rather than cell address. Omunene Excel Discussion (Misc queries) 3 March 2nd 06 01:07 AM
how to make cell content to flash Woytek Excel Discussion (Misc queries) 2 September 21st 05 08:55 PM
How can I make the bar that shows the content of the cell visible. ZG Excel Discussion (Misc queries) 1 January 8th 05 07:27 PM


All times are GMT +1. The time now is 11:28 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"