Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default Delete all cells in range matching certain values

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Delete all cells in range matching certain values

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" wrote in message
ups.com...
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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default Delete all cells in range matching certain values

On 13 Aug, 15:45, "Bob Phillips" 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" wrote in message

ups.com...



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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA: Matching cells across columns, and returning equal values Babymech Excel Discussion (Misc queries) 0 January 26th 09 04:41 PM
Lookup 3 matching values of which one is a range and return a sum Cheryl Excel Worksheet Functions 2 November 30th 08 05:22 AM
display a range of cells editible cells based on matching date Miki Excel Worksheet Functions 0 October 10th 07 03:27 PM
Matching cells & returning values Sharon Excel Programming 8 March 10th 05 03:05 PM
Delete Rows if Certain Values are listed in a Range Name John Excel Programming 6 June 27th 04 10:59 PM


All times are GMT +1. The time now is 09:42 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"