View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Jarek Kujawa[_2_] Jarek Kujawa[_2_] is offline
external usenet poster
 
Posts: 896
Default macro to delete certain results

probably you didn't select an area with "total board" etc.
besides "Then" must be in the same line as "If" (the browser wrapped
it incorrectly)

try this version

Public Sub DeleteStuff()

For Each cell In Selection
If cell = ""total board" or cell = "total metal" or
IsNumeric(cell) or cell.HasFormula or IsError(Cell) Then
cell.Delete
End If

Next cell


End Sub


this macro will delete ONLY cells (fulfilling conditions) in the
SELECTED AREA