Copy current row to clipboard and delete row

  • Thread starter Thread starter GKW in GA
  • Start date Start date
G

GKW in GA

I would like to create a macro that will copy the row of the cell that the
cursor is currently in and delete that row.

How to do?
 
Hi,

The 2 lines below will do what you require but you need to do something in
between because when you delete the row you lose the copied data.

ActiveCell.EntireRow.Copy
'Do something with the copied data i.e paste it somewhere else
ActiveCell.EntireRow.Delete

Mike
 
Mike wrote on Sat, 19 Apr 2008 06:52:00 -0700:

MH> The 2 lines below will do what you require but you need to
MH> do something in between because when you delete the row you
MH> lose the copied data.

MH> ActiveCell.EntireRow.Copy
MH> 'Do something with the copied data i.e paste it somewhere
MH> else ActiveCell.EntireRow.Delete

MH> Mike

MH> "GKW in GA" wrote:

??>> I would like to create a macro that will copy the row of
??>> the cell that the cursor is currently in and delete that
??>> row.

The number of modifications that are available in VBA for
ActiveCell is amazing to me. Can you (or anyone else) suggest a
good book with a reasonably complete list of functions,
prefererably one that also teaches VBA for Excel?


James Silverton
Potomac, Maryland

E-mail, with obvious alterations:
not.jim.silverton.at.verizon.not
 
Mike wrote on Sat, 19 Apr 2008 07:22:00 -0700:

MH> The activecell statement returns a range object and you can
MH> apply any of the properties or methods of a range object to
MH> the active cell.

MH> With regard to a book the one produced by John Walkenbach
MH> is one I found and still find invaluable.

MH>
http://www.amazon.com/Excel-2003-Bible-John-Walkenbach/dp/0764539671

MH> Mike

Thanks, that looks like a good bet. I've used his "Excel 2002
formulas" for a long time; so much so that I have the PDF
version on disk.


James Silverton
Potomac, Maryland

E-mail, with obvious alterations:
not.jim.silverton.at.verizon.not
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top