Macro Help

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.
 
J

JNW

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top