cgcamal
Active Member
- Joined
- May 2, 2007
- Messages
- 472
Hi to all,
I'm trying to execute a Macro (Macro1) if I do Right Click over a cell and I select
from the contextual menu the option "Delete-->Entire Row".
Below in Pseudo code what I'm trying (In red what I don't know how to say to Excel in VBA code):
How can I do this?
PS: I have a "Workbook_SheetChange" in the same ThisWorkbook module, only if matters for this new event I want to monitor.
Many thanks in advance for any help.
Regards.
I'm trying to execute a Macro (Macro1) if I do Right Click over a cell and I select
from the contextual menu the option "Delete-->Entire Row".
Below in Pseudo code what I'm trying (In red what I don't know how to say to Excel in VBA code):
Code:
Private Sub Workbook_SheetBeforeRightClick(ByVal Sh As Object, ByVal Target As Range, Cancel As Boolean)
SelectRow = Target.row
If [COLOR=Red]"Delete Entire Row option" Is selected[/COLOR] Then
[COLOR=Green] 'Before delete entire row[/COLOR]
Run Macro1
[COLOR=Green] 'After Run Macro1 continue the execution of delete entire row[/COLOR]
End If
End Sub
PS: I have a "Workbook_SheetChange" in the same ThisWorkbook module, only if matters for this new event I want to monitor.
Many thanks in advance for any help.
Regards.
Last edited: