rhino4eva
Active Member
- Joined
- Apr 1, 2009
- Messages
- 262
- Office Version
- 2010
- Platform
- Windows
lastrow = Sheets("Sheet1").Range("A" & Rows.Count).End(xlUp).Row
For Count = 2 To lastrow
Range("$a$2:a" & lastrow).Find("Sample").EntireRow.Select
Selection.Delete Shift:=xlUp
Next Count
End Sub
I am trying to develop a module to scan thru sheet1 and delete every line where the word "Sample" occurs
I am using the lastrow technique because the length of the sheet is variable. But I get a runtime 91 error that states object variable or with block variable is not set
I don't know where to go with it ... any ideas will be gratefully received
For Count = 2 To lastrow
Range("$a$2:a" & lastrow).Find("Sample").EntireRow.Select
Selection.Delete Shift:=xlUp
Next Count
End Sub
I am trying to develop a module to scan thru sheet1 and delete every line where the word "Sample" occurs
I am using the lastrow technique because the length of the sheet is variable. But I get a runtime 91 error that states object variable or with block variable is not set
I don't know where to go with it ... any ideas will be gratefully received