If cell value is 0 - How can you make that cell blank?

Larry

New Member
Joined
Apr 4, 2002
Messages
29
I know this is an elementary question, but I am a very new developer with a very complex report to write. I am attempting to do this in a Macro and I am unsure of the code. I have referenced John Walkenbach's books, but I am still stumped.

Any info will be greatly appreciated.
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
On 2002-04-05 14:11, Larry wrote:
I know this is an elementary question, but I am a very new developer with a very complex report to write. I am attempting to do this in a Macro and I am unsure of the code. I have referenced John Walkenbach's books, but I am still stumped.

Any info will be greatly appreciated.
 
Upvote 0
Try the following:

If ActiveCell.Value = 0 Then ActiveCell.Value = ""

I think this is what you want.
 
Upvote 0
you can hide all zero values by going into tools options and deselecting the "zero values" box. Or in VBA the equivilent is...


ActiveWindow.DisplayZeros = False


Or if you want to do it in vba for a single cell,

if range("a1")=0 then range("a1")=""

or...

if cells(rowx,colx)=0 then cells(rowx,colx)=""
 
Upvote 0

Forum statistics

Threads
1,213,532
Messages
6,114,176
Members
448,554
Latest member
Gleisner2

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top