unpopulated blank cells

wmtsub

Active Member
Joined
Jun 20, 2018
Messages
322
Sometimes when working with what looks like cells that look blank they have hidden "0" in it.
That messes with formulas at times. So I thought to scrub the worksheet for cells with non visible characters and set them all to the same one.
So what I like to know is what state is a new unused cell in IE> blank - zero - other. And how to search for and change everything that is not
in use to that. Kind of like below?




Sub Trim_Zero()
'Trim zeros
ActiveSheet.UsedRange.Replace 0, "", lookat:=xlWhole
ActiveSheet.UsedRange.Replace " ", "", lookat:=xlWhole
End Sub
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
Sometimes when working with what looks like cells that look blank they have hidden "0" in it.
If they have a "hidden 0" in them, they probably have a custom format on the cell that hides them (so removing the custom formatting should expose them).

But your code should remove them, regardless. Did you try it?
If that did not work, then you you have some other special characters. If you are unsure what they are, locate on your sheet. Let's say it is in cell B11. Then enter this formula somewhere on your sheet and see what it returns:
=CODE(B11)
This will return the ASCII character code for that entry. Then we will at least know what we are working with, and can work from there.
 
Upvote 0
Another possible reason for hidden zeros

File > Options > Advanced
Under Display options for this workbook
Check if the checkbox beside
Show a zero in cells that have zero value
is checked

M.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,909
Messages
6,175,312
Members
452,634
Latest member
cpostell

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