Probably because the cells which appear blank are not in fact balnk. Check for a space or anything else in those cells.
If you have a formula in those blank cells which may result in the cell containing an empty string (eg.
=IF(A1>10,10,"") ) then commas will show up.
Instead of checking for
Empty, check the length of the cell contents. If at the same time you also want to exclude cells which have only a space or spaces in, then change the line:
Code:
If ignore_empty And IsEmpty(cell.Value) Then
to:
Code:
If ignore_empty And Len(Application.Trim(cell.Value)) = 0 Then