ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Searching cell with zero value and delete their content (https://www.excelbanter.com/excel-programming/454218-searching-cell-zero-value-delete-their-content.html)

Norbert[_4_]

Searching cell with zero value and delete their content
 
Hi everybody,

I have a range of cells which I'd like to search for the value "0%" (or just 0) and then I'd like to delete all these zero values.

The cell range is M17:AF17

All I want is to delete the zero values in that range.

Thanks

Claus Busch

Searching cell with zero value and delete their content
 
Hi Norbert,

Am Sun, 10 Feb 2019 10:25:06 -0800 (PST) schrieb Norbert:

I have a range of cells which I'd like to search for the value "0%" (or just 0) and then I'd like to delete all these zero values.

The cell range is M17:AF17

All I want is to delete the zero values in that range.


try:

Sub DeleteZeros()
Dim rngC As Range

For Each rngC In Range("M17:AF17")
If rngC = 0 Then rngC.ClearContents
Next
End Sub


Regards
Claus B.
--
Windows10
Office 2016

GS[_6_]

Searching cell with zero value and delete their content
 
Hi everybody,

I have a range of cells which I'd like to search for the value "0%" (or just
0) and then I'd like to delete all these zero values.

The cell range is M17:AF17

All I want is to delete the zero values in that range.

Thanks


Do you mean you want to hide zero values? Do you know that option canned be
turned off (OptionsViewWindowOptions) so cells with zero values appear empty?

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion


All times are GMT +1. The time now is 12:20 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com