• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

VBA Code to remove Zero from Cells

I have tried recording macros doing the Control+Find / Replace option but land-up with incorrect output. Normally end up removing the '0' from 10,20 and 30 not what I want...

Code needed to do the following:
1) Cell B4:O8 - Look for '0' (Zero) - not the 10,20,30.... (basically anything less than 1)
2) Replace it as blank or null
3) Cell Range is not limited to B4:O8 but could be B4:O20 - the table keeps changing.

Would really appreciate any assistance possible.

Thanks in advance.
 

Attachments

  • Format Blocks.xlsb
    11.3 KB · Views: 3
Your bad : when you operate manually you must choose the appropriate option like for the whole cell content instead of a cell part …​
 
As no code was posted just activate the Macro Recorder and operate manually :​
if the result is the expected one so you well answered to the search assistant then​
the generated code has now all the necessary, just compare with the former one …​
Another easy way is to just read the VBA inner help of the method used within the code​
where you can easily see which parameter you must correct …​
 
Back
Top