?
Solved

Excel Delete Event

Posted on 2003-04-01
11
Medium Priority
?
482 Views
Last Modified: 2007-12-19
I know that Excel doesn't provide an event for delete. So how can we detect whether user delete some rows or cells and know which ranges that user just delete (if possible, also provide a way to cancel that?
0
Comment
Question by:testn
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
  • 2
  • +3
11 Comments
 
LVL 4

Expert Comment

by:GoBanana
ID: 8248933
And why, may I ask, do you want to do that? Why not simply lock cells that should not be deleted?

There is a change event. May that perhaps be of interest?Hard for me tell since I do not know your intentions with your excel model.

GoBanana
0
 
LVL 9

Expert Comment

by:pauloaguia
ID: 8248984
The change event won't necessarily be triggered by that. And when it is it's already too late.

If any of the events may help you it would be the SelectChange event. You could prevent a user from selecting those rows (to delete, copy, paste, whatever).

But I think you'd be better of by protecting the sheet as GoBanana suggested...

Paulo
0
 
LVL 1

Expert Comment

by:macrodev
ID: 8250598
How about using "Track Changes"?

Click on the Tools menu...Track Changes...Highlight Changes

0
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 
LVL 3

Expert Comment

by:randomgurn
ID: 8252830
This is a problem I came across recently also.  I wanted to know if the shapes of certain ranges had changed.  I didn't actually get round to implementing it, but here is what I thought of:-

You can store each of your particular ranges in, say, an array.  These are just pointers to ranges, so they get automatically updated.  You can then use the WorksheetChange event, and check to see whether these ranges have changed shape.

Of course, that doesn't stop the user deleting the range...
0
 
LVL 18

Author Comment

by:testn
ID: 8255974
The app that I am developing is the app keep track of information. So if users delete something, it will popup to ask reasons why they want to delete. So that I can move the existing data to somewhere else and also keep the reason. That's why I need that event
0
 
LVL 9

Expert Comment

by:pauloaguia
ID: 8256054
How about this scenario:

* You protect the sheet.
* Whenever someone wants to delete something selects it and then presses a button on a toolbar (or a shortcut key combination that you assign to it such as Ctrl+X, for instance)
* A dialog box then pops up to allow the user to enter the information you want.
* The sheet is then unprotected, the cells deleted and the sheets gets reprotected again.

However with the sheet selected you'll loose the ability to change the cells values, widths, formating, etc. You won't loose the ability to insert new values if you do it right and use the change event to only lock the cells with values.

What do you think about this acenario?

Paulo
0
 
LVL 18

Author Comment

by:testn
ID: 8265801
I think it's too difficult. My users are ranging from a novice user to an expert. So I'm quite reluctant to do that.
0
 
LVL 9

Expert Comment

by:pauloaguia
ID: 8267925
It doesn't take an expert to press a button (I may have not explained properly. All those steps would be made automatically at the press of a button).

But if you think it's too hard then I won't go on with it.

It was worth to try anyway :)

Paulo
0
 

Expert Comment

by:DigitalXtreme
ID: 8409701
testn has requested that this question be deleted and points refunded. If there are any objections to this action please post here within 72 hours or I will complete the action. Thank you. :)

DigitalXtreme
CS Moderator
0
 
LVL 9

Expert Comment

by:pauloaguia
ID: 8411393
I would like to suggest this question to be PAQ'd rather than deleted. What testn requested just can't be done but there are some (viable?) alternatives already posted here and that can be of some help for someone else.

Paulo
0
 

Accepted Solution

by:
DigitalXtreme earned 0 total points
ID: 8424139
question PAQ'ed and points refunded.

DigitalXtreme
CS Moderator
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I was prompted to write this article after the recent World-Wide Ransomware outbreak. For years now, System Administrators around the world have used the excuse of "Waiting a Bit" before applying Security Patch Updates. This type of reasoning to me …
This article describes how you can use Custom Document Properties to store settings and other information in your workbook so that they will be available the next time you open the workbook.
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question