Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 173
Default Make zeroes in Selection nothing ""


My code navigates to and selects a range, then needs to change all zeroes to
blanks, nothing, "" .

Is there a quick trick to this that I'll slap my forehead over?

Thanx,
- Mike
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,836
Default Make zeroes in Selection nothing ""

This will do it for you:

Sub DelZeros()
For X = 1 To 1
Dim redRng As Range

Set redRng = Range("A1", Range("J100").End(xlUp))
For Each Cell In redRng

If Cell.Value = 0 Then
Cell.Value = ""
End If

Next Cell
Next X
End Sub

Remember to make a back of your Excel file, just in case the result
is...ummmm...unintended. It's a total PITA to try to recover lost data.

Also, notice the range, A1:J100. Change to suit your needs.

Regards,
Ryan---

--
RyGuy


"MikeF" wrote:


My code navigates to and selects a range, then needs to change all zeroes to
blanks, nothing, "" .

Is there a quick trick to this that I'll slap my forehead over?

Thanx,
- Mike

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Make zeroes in Selection nothing ""

Are they values or formulas?

If they're values:

Select the range and then
edit|replace
what: 0
with: (leave blank)
replace all

Make sure you match entire cell constants.

Record a macro when you do it manually and you'll have the code.

MikeF wrote:

My code navigates to and selects a range, then needs to change all zeroes to
blanks, nothing, "" .

Is there a quick trick to this that I'll slap my forehead over?

Thanx,
- Mike


--

Dave Peterson
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
make a "selection" in a word document from a module in excel eholz1 Excel Programming 2 September 20th 06 04:57 PM
Make "Edit" mode default, rather than "Enter"? Greg Boettcher Excel Discussion (Misc queries) 1 July 27th 06 01:46 AM
Problem: zeroes added to "general" format cell gio123bg Excel Worksheet Functions 2 June 20th 06 02:46 PM
If changed array formula reduce ""\""\""\ - signs to #Missing, will it make ... Maria J-son[_2_] Excel Programming 2 March 5th 06 12:20 PM
how can I make an excel cell "mark" or "unmark" when clicked on? Rick Excel Discussion (Misc queries) 6 January 8th 06 10:15 PM


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

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"