View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
KelliInCali KelliInCali is offline
external usenet poster
 
Posts: 37
Default run-time error 1004

I don't know why I didn't think of the filtering! I used this and it seems
to work fine, automatically undoing the filter after delete and leaving only
the desired rows:

Cells.Select
Selection.AutoFilter
Selection.AutoFilter Field:=15, Criteria1:="DELETE"
Selection.Delete

Per my reply after your filtering suggestion though, I am still trying to
eliminate the need for "over-estimating" the number of rows to down-fill the
formulas, making it be relative to the used space.

thanks!!
kelli




"Bill Renaud" wrote:

(Untested): You could also use AutoFilter to show only rows that have
"Delete" (or whatever your formula inserted) in them.
Then use:

Set rngMarkedCells = rngData.SpecialCells(xlCellTypeVisible)

You might stilll have to Copy and PasteSpecial to eliminate the formulas
before doing the AutoFilter method, to prevent the cell values from
changing.
--
Regards,
Bill Renaud