Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
alert before deleting contents of a cell
Is there a way to make excel alert me before deleting the contents of a cell?
In other words, if I select a cell and hit delete, I want excel to ask something like this, "Are you sure you want to delete the contents of this cell. Yes or No". Thanks in advance |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
alert before deleting contents of a cell
Excel doesn't know that a cell has been cleared until it has been cleared.
What you can do is use a Worksheet_Change event macro that would, if the cell is blank, issue a Undo command to restore the previous value, then display a message box asking you whatever, and clear the cell if you say Yes. Essentially, Excel would be doing what you asked for but in a round-about way. Post back if this sounds like what you want and need help with it. Include more detail about what cells you want this to operate on. Note that you cannot setup the macro to operate on all files and all sheets. You can set it up on a one sheet basis or on a one file basis. HTH Otto "Mortgage Man" wrote in message ... Is there a way to make excel alert me before deleting the contents of a cell? In other words, if I select a cell and hit delete, I want excel to ask something like this, "Are you sure you want to delete the contents of this cell. Yes or No". Thanks in advance |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
alert before deleting contents of a cell
This does sound like what I need, but I have never worked with macros and
would be grateful for some help with them. I am trying to make a weekly calendar with the days of the week across the top row and the times of each day down the left side column. This will be used for scheduling appointments in a CPA office. We want the macro to operate on cells B4:G30. Basically we want the program to alert us before deleting the contents of a cell so that we do not accidentally erase an appointment. Thanks "Otto Moehrbach" wrote: Excel doesn't know that a cell has been cleared until it has been cleared. What you can do is use a Worksheet_Change event macro that would, if the cell is blank, issue a Undo command to restore the previous value, then display a message box asking you whatever, and clear the cell if you say Yes. Essentially, Excel would be doing what you asked for but in a round-about way. Post back if this sounds like what you want and need help with it. Include more detail about what cells you want this to operate on. Note that you cannot setup the macro to operate on all files and all sheets. You can set it up on a one sheet basis or on a one file basis. HTH Otto "Mortgage Man" wrote in message ... Is there a way to make excel alert me before deleting the contents of a cell? In other words, if I select a cell and hit delete, I want excel to ask something like this, "Are you sure you want to delete the contents of this cell. Yes or No". Thanks in advance |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Cell References | Excel Discussion (Misc queries) | |||
Selectively Clearing cell contents | Excel Worksheet Functions | |||
Using contents of a cell in a formula | Excel Discussion (Misc queries) | |||
Possible Lookup Table | Excel Worksheet Functions | |||
Can I use the contents of a cell to satisfy the result_vector arg. | Excel Worksheet Functions |