Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Deleting zero values

How do I delete zero values in cells? It would be great to have a macro to
run to remove any zero values.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Deleting zero values

If you don't want to see them, you can go to tools=Options=View and
uncheck Zeros.

If you really want to remove them

dim rng as Range, cell as Ragne
Dim rng1 as Ragne
on error resume next
set rng = Activesheet.UsedRange.Specialcells(xlConstants, xlNumbers)
set rng1 = Activesheet.UsedRange.SpecialCells(xlFormulas, xlNumbers)
On Error goto 0
if not rng is nothing then
for each cell in rng
if cell.value = 0 then cell.clearcontents
next
end if
if not rng1 is nothing then
for each cell in rng1
if cell.value = 0 then cell.clearcontents
next
end if

--
Regards,
Tom Ogilvy

"K McCurry" <K wrote in message
...
How do I delete zero values in cells? It would be great to have a macro

to
run to remove any zero values.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Deleting zero values

Thank You!!! That worked Great!

"Tom Ogilvy" wrote:

If you don't want to see them, you can go to tools=Options=View and
uncheck Zeros.

If you really want to remove them

dim rng as Range, cell as Ragne
Dim rng1 as Ragne
on error resume next
set rng = Activesheet.UsedRange.Specialcells(xlConstants, xlNumbers)
set rng1 = Activesheet.UsedRange.SpecialCells(xlFormulas, xlNumbers)
On Error goto 0
if not rng is nothing then
for each cell in rng
if cell.value = 0 then cell.clearcontents
next
end if
if not rng1 is nothing then
for each cell in rng1
if cell.value = 0 then cell.clearcontents
next
end if

--
Regards,
Tom Ogilvy

"K McCurry" <K wrote in message
...
How do I delete zero values in cells? It would be great to have a macro

to
run to remove any zero values.




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
Deleting values less than 100 PointerMan Excel Worksheet Functions 3 May 17th 23 11:44 AM
deleting values in a worksheet without deleting the formulas patti Excel Worksheet Functions 1 October 28th 05 09:49 PM
Deleting/Changing values teresa Excel Programming 2 January 23rd 05 05:20 PM
deleting dupes/certain values slliks Excel Programming 1 October 22nd 04 03:11 AM
Deleting Rows with Same Values ...Patrick[_5_] Excel Programming 0 September 8th 04 09:06 PM


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

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

About Us

"It's about Microsoft Excel"