Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
make a "selection" in a word document from a module in excel | Excel Programming | |||
Make "Edit" mode default, rather than "Enter"? | Excel Discussion (Misc queries) | |||
Problem: zeroes added to "general" format cell | Excel Worksheet Functions | |||
If changed array formula reduce ""\""\""\ - signs to #Missing, will it make ... | Excel Programming | |||
how can I make an excel cell "mark" or "unmark" when clicked on? | Excel Discussion (Misc queries) |