Excel Macro to delete rows

  • Thread starter Thread starter Harsh
  • Start date Start date
H

Harsh

Hello,

I have an excel Sheet in which I have a blank row below the cell which
contains "<<<Mem>>>".
I vave some random data and multiple such cells. Can I get some help
with the excel macros for the same?

Harsh
 
Assuming "Mem" is in column E:
Sub DeleteRowBelowMem()
For i=cells(rows.count,5).end(xlup).row to 1 step -1
if cells(i,5).value="Mem" then rows(i+1).Delete
Next
End Sub

Bob Umlas
Excel MVP
HTH
 
Thank you Bob,

My problem is solved. I appreciate your help.

Dhawal
 

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

Back
Top