You may have cells that have been "cleared" by typing in a space character. Instead of using the IsEmpty function try using this function instead.
Public Function IsEmptyOrWhiteSpace(cell As Excel.Range) As Boolean
Select Case VBA.VarType(cell.Value2)
Case VBA.VbVarType.vbEmpty
IsEmptyOrWhiteSpace = True
Case VBA.VbVarType.vbString
Dim testString As String
testString = Trim$(Replace$(cell.Value2, ChrW$(160), ChrW$(32)))
IsEmptyOrWhiteSpace = (Len(testString) = 0)
End Select
End Function
If this does not work, please upload a sample workbook. You can upload files by clicking on the "Go Advanced" button next to "Post Reply" and then clicking on the paperclip icon in the toolbar.
Bookmarks