Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
DDK DDK is offline
external usenet poster
 
Posts: 3
Default 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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default 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.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Find and delete all other rows Murray Excel Discussion (Misc queries) 1 August 7th 07 02:54 AM
Find Column heading and then Delete entire column Kobayashi[_58_] Excel Programming 4 October 17th 05 09:09 PM
Find & Delete Rows Steve Wallis Excel Programming 2 June 17th 05 07:06 AM
find and delete rows sulie[_2_] Excel Programming 2 June 7th 05 09:47 AM
macro to find something in column A and delete 5 rows below it vikram Excel Programming 1 April 30th 04 12:04 PM


All times are GMT +1. The time now is 06:10 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"