Macro Help

  • Thread starter Thread starter DFrank
  • Start date Start date
D

DFrank

I am making a macro that deletes #N/A's, but i want to add a few things to it
that should be deleted:

the phrases "total board" and "total metal", and any non-text (i.e. any
number) that appears.

this is what i have so far:

Public Sub DeleteStuff()
Cells.SpecialCells(xlCellTypeFormulas, xlErrors).Delete
End Sub



what do i add to meet my specifications? thanks.
 
Try this
Public Sub DeleteStuff()
dim cell as range
Cells.SpecialCells(xlCellTypeFormulas, xlErrors).Deletefor each cell in
cells
if cell.value = "total board" _
or cell.value = "total metal" _
or isnumber(cell.value) = true then
cell.clearcontents
end if
next cell

End Sub
 
Back
Top