Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
VB Code to stop cells being deleted
I would like to write some VB code to stop users deleting the contents of cells in excel. The cells need to be unprotected as users need to input values in them, however, they have formulas in which link to a database. If a user presses the delete button they will remove the formula.
I need to write some code which activates when the delete button is hit. I have written some code, however, can only get it to activate when a button is clicked. Can anyone help? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
VB Code to stop cells being deleted
How can they input values unless they directly edit the formula?
If your users do actually edit the formula then I suggest you change your input routine. Make the input cells values only (which you can leave unlocked) and make references in the formulas to those cells (which can be locked). -- Regards Andy Wiggins www.BygSoftware.com Home of "Save and BackUp", "The Excel Auditor" and "Byg Tools for VBA" "T Jeanes" <T wrote in message ... I would like to write some VB code to stop users deleting the contents of cells in excel. The cells need to be unprotected as users need to input values in them, however, they have formulas in which link to a database. If a user presses the delete button they will remove the formula. I need to write some code which activates when the delete button is hit. I have written some code, however, can only get it to activate when a button is clicked. Can anyone help? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
VB Code to stop cells being deleted
Thanks for your help. Excel is just the front end of an external database and thus the formulas in the cells relate to references to the database. i.e. when somebody enters 10 they are actually writing 10 to the database.
I need a macro which is running in the backround, like a worksheet event, that will detect if a user hits the delete button. If they press delete I want a message box to appear asking them to instead enter 0. "Andy Wiggins" wrote: How can they input values unless they directly edit the formula? If your users do actually edit the formula then I suggest you change your input routine. Make the input cells values only (which you can leave unlocked) and make references in the formulas to those cells (which can be locked). -- Regards Andy Wiggins www.BygSoftware.com Home of "Save and BackUp", "The Excel Auditor" and "Byg Tools for VBA" "T Jeanes" <T wrote in message ... I would like to write some VB code to stop users deleting the contents of cells in excel. The cells need to be unprotected as users need to input values in them, however, they have formulas in which link to a database. If a user presses the delete button they will remove the formula. I need to write some code which activates when the delete button is hit. I have written some code, however, can only get it to activate when a button is clicked. Can anyone help? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Remove Cell Color after Code is Deleted | Excel Discussion (Misc queries) | |||
How to stop printing the VB Code Result | Excel Discussion (Misc queries) | |||
Stop rows from being deleted whilst allowing cells contents to cha | Excel Discussion (Misc queries) | |||
How do I stop other circles in other cells to stop selecting? | Excel Worksheet Functions | |||
Stop Excel Updating formulas when cells are deleted? | Excel Programming |