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

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
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,214,798
Messages
6,121,636
Members
449,043
Latest member
farhansadik

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