Entering Almost Nothing

G

Gary''s Student

If I want to enter a null character in a cell, I:

1. enter ="" in A1
2. copy A1
3. select A2
4. paste/special/value

A2 will now contain the null (ISBLANK(A2) will display FALSE)

Is there any way I can accomplish this without using this cumbersome process?
 
P

Pete_UK

You could just type a single apostrophe in A2 (or does that not
count?).

Hope this helps.

Pete
 
G

Gary''s Student

I would rather not use a prefix character.

By the way, I can't even figure out how to do this in VBA without a
copy/paste!!!

Thanks for the reply
 
J

JoeU2004

Gary''s Student said:
I would rather not use a prefix character.
By the way, I can't even figure out how to do this in VBA

I think you want a cell that is treated as text (specifically the null
string), but the cell contains no visible characters and no formula. TYPE()
should return 2, LEN() should return 0, and ISBLANK() should return FALSE
(or perhaps that's what you want to determine).

If you are content to change the cell format to Text, then:

range("a1").numberformat = "@"
range("a1") = ""

If you want to preserve the original format (e.g. General), then:

oldform = range("a1").numberformat
range("a1").numberformat = "@"
range("a1") = ""
range("a1").numberformat = oldform

I'd be interested in a simpler way. Neither of the following works:

range("a1") = ""

or

range("a1").value2 = ""


----- original message -----
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top