PC Review


Reply
Thread Tools Rate Thread

Delete all cells in range matching certain values

 
 
Tommy
Guest
Posts: n/a
 
      13th Aug 2007
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

 
Reply With Quote
 
 
 
 
Bob Phillips
Guest
Posts: n/a
 
      13th Aug 2007
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)

"Tommy" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>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
>



 
Reply With Quote
 
Tommy
Guest
Posts: n/a
 
      13th Aug 2007
On 13 Aug, 15:45, "Bob Phillips" <bob....@somewhere.com> wrote:
> 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)
>
> "Tommy" <t9999ba...@gmail.com> wrote in message
>
> news:(E-Mail Removed)...
>
>
>
> >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- Hide quoted text -

>
> - Show quoted text -


gracias

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
The Road- Matching data within a range of values Rambo Microsoft Excel Programming 1 7th Feb 2011 08:08 PM
Lookup 3 matching values of which one is a range and return a sum Cheryl Microsoft Excel Worksheet Functions 2 30th Nov 2008 05:22 AM
display a range of cells editible cells based on matching date =?Utf-8?B?TWlraQ==?= Microsoft Excel Worksheet Functions 0 10th Oct 2007 03:27 PM
Matching cells & returning values =?Utf-8?B?U2hhcm9u?= Microsoft Excel Programming 8 10th Mar 2005 03:05 PM
Matching values in different cells Carlos Microsoft Excel Worksheet Functions 1 28th Aug 2003 05:23 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:52 PM.