removing specific rows in a worksheet
Hi Louise,
Try this backup your file first
I suppose that Store Manager is in column C, change it to fit your
requirements
Sub delete_Me()
Dim copyrange As Range
Lastrow = Cells(Cells.Rows.Count, "C").End(xlUp).Row
Set MyRange = Range("C1:C" & Lastrow)
For Each c In MyRange
If InStr(c, "Store Manager") Then
If copyrange Is Nothing Then
Set copyrange = c.EntireRow
Else
Set copyrange = Union(copyrange, c.EntireRow)
End If
End If
Next
If Not copyrange Is Nothing Then
copyrange.Delete
End If
End Sub
"Louise" wrote:
Hi all
I have a large worksheet containing thousands of rows beginning with the
words 'store manager'. I need to remove every row in the workbook beginning
with these two words.
Is there an easy way to do this?
Thank you.
Louise
|