Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
how to make the content in an excel cell read only?!
|
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
how can I make a cell content equal the tab name 'sheet1' ? | Excel Worksheet Functions | |||
Make a cell content not printable | Excel Worksheet Functions | |||
How make hyperlink refer to cell content rather than cell address. | Excel Discussion (Misc queries) | |||
how to make cell content to flash | Excel Discussion (Misc queries) | |||
How can I make the bar that shows the content of the cell visible. | Excel Discussion (Misc queries) |