Find a row with a given value in column A and delete all rows belo

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have written a VBA procedure to import a text file, format it. Now I need
to add the capability to check for a value in column A. When I find that
value, I then want to delete that row and all other rows below that row, all
from within the VBA procedure.
 
Turn on the macro recorder and then do Edit=>Find and search for your target
value. then turn off the macro recorder and look at the recorded code.

Then add the line
Range(activeCell,"A65536").entireRow.Delete
 

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