Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default macro to find something in column A and delete 5 rows below it

macro to find something in column A and delete 5 rows below it


suppose i have bank name in that excel file and i want that a macr
should loop through whole of the file and whenever it finds bank nam
in column A it deletes that entire row and 4 rows below it

please help
i will be thankfu

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default macro to find something in column A and delete 5 rows below it

HTH

Sub del5()
For Each cel In Range(Range("A1"), Range("A65536").End(xlUp))
If cel.Value = "bank" Then
Range(cel, cel.Offset(4, 0)).EntireRow.Delete
End If
Next
End Sub


vikram < wrote:

macro to find something in column A and delete 5 rows below it


suppose i have bank name in that excel file and i want that a macro
should loop through whole of the file and whenever it finds bank name
in column A it deletes that entire row and 4 rows below it

please help
i will be thankful


---
Message posted from http://www.ExcelForum.com/


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
macro to delete rows if cell blank in column puiuluipui Excel Discussion (Misc queries) 4 October 15th 09 05:22 PM
find and delete rows macro clayton ledford Excel Discussion (Misc queries) 4 January 20th 09 03:34 PM
Find and delete all other rows Murray Excel Discussion (Misc queries) 1 August 7th 07 02:54 AM
Macro to find and delete rows! Heather O'Malley Excel Discussion (Misc queries) 2 April 12th 06 01:53 PM
Find item and delete rows Joseph[_28_] Excel Programming 1 April 20th 04 06:55 PM


All times are GMT +1. The time now is 03:19 AM.

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"