Delete all cells in range matching certain values

  • Thread starter Thread starter Tommy
  • Start date Start date
T

Tommy

I have a range selected dynamically using this: Range(Cells(4, 3),
Cells(4, 3).End(xlDown)).Select

Within the range is a list of strings.However some of the cells
contain the value "0". I would like to be able to sort through the
selected range and delete the value 0 from the cells containing this
value so that I end up with just a blank, clear cell in its place. The
reason for this is that the range eventually gets sorted for non-empty
cells so I need the 0 removed if present. How would I go about this
using VBA?

Regards,

Tom
 
For Each cell In Range(Cells(4, 3),Cells(4, 3).End(xlDown))
If Cell.Value = 0 Then cell.Value =""
Next cell

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
For Each cell In Range(Cells(4, 3),Cells(4, 3).End(xlDown))
If Cell.Value = 0 Then cell.Value =""
Next cell

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)







- Show quoted text -

gracias
 

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

Back
Top