Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel Blank the Cell command on Zero But decimals remove 1

Status
Not open for further replies.

mstrcmtr

Programmer
Nov 14, 2007
103
0
0
PK

By the help of following command in Excel Blank the Cell if Zero

e.g. i = 30

oXs.Range('Z5:'+ 'Z'+ALLTRIM(STR(i))).NumberFormat = '0;-0;;@'

But it will also remove the decimals

What is the way to protect decimals and as well as blank if cell has zero value
 
Is it as simple as changing the format string to include fixed decimals?
'0.00;-0.00;;@'

Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.

I'm trying to cut down on the use of shrieks (exclamation marks), I'm told they are !good for you.
 
Pleased you are happy

Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.

I'm trying to cut down on the use of shrieks (exclamation marks), I'm told they are !good for you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top