Thread: Deleting Rows
View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
JLGWhiz[_2_] JLGWhiz[_2_] is offline
external usenet poster
 
Posts: 1,565
Default Deleting Rows

Don't know what I was thinking. that will delete the wrong row, since you
have already deleted the row with the criteria string. So:

For Lrow = LastRow To FirstRow Step -1
If .Cells(Lrow, "A").Value = "Employee Name" Then _
.Rows(Lrow).Delete
.Rows(Lrow).Delete
Next Lrow



"mooresk257" wrote in message
...
Hi Folks,

I want to delete two rows - one row has the words "Employee Name" in the
first column, and the row before it. This for-next loop removes the row
with
"Employee Name":

For Lrow = LastRow To FirstRow Step -1
If .Cells(Lrow, "A").Value = "Employee Name" Then _
.Rows(Lrow).Delete
Next Lrow

Any suggestions how to delete the row with "Employee Name" and the one
before it?

Thanks!

Scott