View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.misc
Ayo Ayo is offline
external usenet poster
 
Posts: 489
Default Need Help with ActiveCell.EntireRow.Delete

This one didn't work at all.

"Jarek Kujawa" wrote:

sorry, this IS a better idea


Private Sub cmdCopy_Click()
Dim ClastRow As Integer, c As Range


Worksheets("BulkUploadReport 1 ").Delete
Windows("BulkUploadReport 1 .xls").Activate
Sheets("BulkUploadReport 1 ").Select
Sheets("BulkUploadReport 1 ").Copy
After:=Workbooks("Vista.xls").Sheets(1)


Sheets("BulkUploadReport 1 ").Select
ClastRow = ActiveCell.SpecialCells(xlCellTypeLastCell).Row
For i=ActiveSheet.Range("E2:E" & ClastRow).Cells.Count To 2 Step
-1
If cells(i,5).Value < Worksheets("Sheet1").Range("I16").Value
Then
cells(i,5).EntireRow.Delete
End If
Next c
End sub