cgcamal
Active Member
- Joined
- May 2, 2007
- Messages
- 472
Hi to all,
I'm looking a way to detect when delete button is pressed over a cell or range, and when that happens,
store the content of that cell or range before be deleted (before content disappear) in order to use the
content that will be deleted as a trigger to execute another code.
For some reference I'm using the below code to run some code when a value is entered in any cell, but
now I need to run other code if the content of any cell is deleted and I need to know which content
is deleted.
Is there a way to do this?
Many thanks for any advice.
Best regards
I'm looking a way to detect when delete button is pressed over a cell or range, and when that happens,
store the content of that cell or range before be deleted (before content disappear) in order to use the
content that will be deleted as a trigger to execute another code.
For some reference I'm using the below code to run some code when a value is entered in any cell, but
now I need to run other code if the content of any cell is deleted and I need to know which content
is deleted.
Is there a way to do this?
Code:
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
Ad = Target.Address
If IsEmpty(Range(Ad)) Then
Exit Sub [COLOR=Green]'If a value is deleted do nothing [B]-->Old code[/B][/COLOR]
[COLOR=Green] 'Now [/COLOR][COLOR=Green]I need to run other code if the content of any cell is deleted.[/COLOR] [B][COLOR=Green]-->New code[/COLOR][/B]
End If
.
.
End sub
Best regards
Last edited: