Deleting values less than 100

P

PointerMan

I want to select a large range of cells and delete the cells that have a
value less than 100. Any suggestions?
 
J

Jarek Kujawa

seems to me you look for ClearContents instead of deleting cells. use
this macro

Sub sth()
Dim cell As Range

For Each cell In Selection
If cell.Value < 1000 Then
cell.ClearContents
End If
Next cell


End Sub
 
G

Gary''s Student

Select the cells and run this macro:

Sub clearsmall()
Dim r As Range
For Each r In Selection
If r.Value < 100 Then
r.Clear
End If
Next
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