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

V

vikram

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
 
Y

yogendra joshi

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
 

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

Top