ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Delete a row that is double clicked (https://www.excelbanter.com/excel-programming/448567-delete-row-double-clicked.html)

Robert Crandal[_2_]

Delete a row that is double clicked
 
What is a quick and fast way to delete a row that is
double clicked by the user?

I know I must handle the Worksheet_BeforeDoubleClick()
function and the "Target" parameter. What comes next?

Using Excel's "Record Macro" function, it generated the
following code to delete a row: (Row 12 was clicked here)

Rows("12:12").Select
Selection.Delete Shift:=xlUp

I need to somehow incorporate the "Target" parameter into
the Rows object, right?





Claus Busch

Delete a row that is double clicked
 
Hi Robert,

Am Tue, 9 Apr 2013 03:13:43 -0700 schrieb Robert Crandal:

Rows("12:12").Select


try:
Target.EntireRow.Delete


Regards
Claus Busch
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2

Robert Crandal[_2_]

Delete a row that is double clicked
 
"Claus Busch" wrote:

try:
Target.EntireRow.Delete


Awesome! I like that better than the code that Excel's
"Record Macro" function generates. Thanks!




All times are GMT +1. The time now is 02:33 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com