ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Find a row with a given value in column A and delete all rows belo (https://www.excelbanter.com/excel-programming/390733-find-row-given-value-column-delete-all-rows-belo.html)

DDK

Find a row with a given value in column A and delete all rows belo
 
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.

Tom Ogilvy

Find a row with a given value in column A and delete all rows belo
 
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

--
Regards,
Tom Ogilvy



"DDK" wrote:

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.



All times are GMT +1. The time now is 05:02 AM.

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