Hey all. I'm having a weird issue that I just can't seem to resolve. I have a macro that runs through the cells in column A of my worksheet and looks to see which cells are empty and which contain *something*. It actually used to work fine, then the format of my spreadsheet changed, and suddenly my macro was reporting that no cell was empty. I added a few extra checks (just to cover more bases) and now only *some* of the empty cells are still passing the test (when I need them to fail). My cell-checking code looks like this now:
First, I was only testing for a "" in the cell. Since that stopped working (and since I'm not sure exactly what Empty means), I added the test for Empty and the test for a space character.
What's happening here is that the If statement is evaluating to true even for cells that appear empty. There are no hidden characters, no formulae, nothing (that I'm aware of). I've even tried right-clicking the first offending cell in my input file and clearing the contents, but it keeps reading it as something other than empty.
Any suggestions?
TIA,
Jas
Code:
If (Not (InputFile.Range("A" & intCounter).Value = Empty)) And (InputFile.Range("A" & intCounter).Value <> "") And (InputFile.Range("A" & intCounter).Value <> " ") Then
First, I was only testing for a "" in the cell. Since that stopped working (and since I'm not sure exactly what Empty means), I added the test for Empty and the test for a space character.
What's happening here is that the If statement is evaluating to true even for cells that appear empty. There are no hidden characters, no formulae, nothing (that I'm aware of). I've even tried right-clicking the first offending cell in my input file and clearing the contents, but it keeps reading it as something other than empty.
Any suggestions?
TIA,
Jas