Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Have code check cell contents on edit.
Hi,
I am trying to identify if there is a way of having a worksheet unprotected but preventing a cell from being edited (using the 'F2' button or simply typing into it) if there is a formulae in it ('=' in the first character). I can see how to check after the change has been made using Worksheet_Change(ByVal Target As Range) but is there 'BEFORE_CHANGE' method. The reason I want this is becuase we want end users to be able to sort, insert etc as usual but if they select cell 'B4' and type or press the 'F2' button a message box will appear saying they can't edit. Andrew 160108 -- Andrew |
#2
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Have code check cell contents on edit.
Hi Andrew,
Can use the Change event and the Selection_Change events together. With the Selection_Change event you record the contents of a cell that the user moves to and store this in a global variable. If the user makes change to the restricted area the Change event 1. puts the value of the variable back into the cell and then displays a warning message. By the way you can protect the worksheet and still allow inserting of rows and columns, sorting and many other things. -- Cheers, Shane Devenshire "Andrew" wrote: Hi, I am trying to identify if there is a way of having a worksheet unprotected but preventing a cell from being edited (using the 'F2' button or simply typing into it) if there is a formulae in it ('=' in the first character). I can see how to check after the change has been made using Worksheet_Change(ByVal Target As Range) but is there 'BEFORE_CHANGE' method. The reason I want this is becuase we want end users to be able to sort, insert etc as usual but if they select cell 'B4' and type or press the 'F2' button a message box will appear saying they can't edit. Andrew 160108 -- Andrew |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Check cell contents before print | Setting up and Configuration of Excel | |||
Edit macro to match entire cell contents | Excel Discussion (Misc queries) | |||
IF statement to check cell contents | Excel Worksheet Functions | |||
How can I edit cell contents with a macro in Excel? | Excel Discussion (Misc queries) | |||
How can I edit cell contents with a macro in Excel? | Excel Discussion (Misc queries) |