Checking for empty

tiredofit

Well-known Member
Joined
Apr 11, 2013
Messages
1,834
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
I check for emptiness by typing this into the immediate window:

Code:
?IsEmpty(Sheet1.Cells(1,1).Value)

and it returns False

But when I type:

Code:
?Len(Sheet1.Cells(1,1).Value

I get a value of 0!

Can someone tell me what is going on?

Is the worksheet corrupt?
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
If you select the cell & look in the formula bar, do you see anything?
 
Upvote 0
Odd, as both is blank reports False & using Ctrl right arrow stops at G1, there has to be something there, but not sure what.
 
Upvote 0
I agree but can't see anything.

Another Excel quirk is all I can say.

LEN(G1) returns 0 too.
 
Upvote 0
In that case it's probably a Null String. If you type this in the immediate window & hit enter does is blank become true
VBA Code:
[g1].value=[g1].value
 
Upvote 0
On the Sheet, =ISBLANK(G1) showed FALSE. (This is cell G3).

When I typed:

Code:
[g1].value=[g1].value

and pressed return, the immediate window didn't show anything but cell G3 now showed TRUE.
 
Upvote 0
In that case it was a nullstring.
 
Upvote 0

Forum statistics

Threads
1,216,028
Messages
6,128,395
Members
449,446
Latest member
CodeCybear

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