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

  • Thread starter Thread starter vikram
  • Start date Start date
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
 
Hi Vikram!

This might be a good example where you would find it useful to have
go at writing your own macro.

Make sure you are well-backed-up.

Now: try recording a macro for the actions of selecting a cell in
with a bank name in it: selecting that whole row and the 4 below it (b
selecting the row numbers): then Edit>Delete will take out the 5 rows
 
try
Sub deletebank()
For Each c In Selection
If UCase(c) = "BANK" Then c.Resize(6, 1).EntireRow.Delete
Next
End Sub
 
Back
Top