It is VERY important that I get this right:
If a cell contains the value 'some string and I set range object "c" to equal that cell, it appears that when I refer to c.formula it ignores/strips off the leading quote. Is this always true? For example:
returns an x value of "some string" (without the leading quote). Will it always do this (across XL versions, etc)?
WHY (if you care):
I coded an add-in that encrypts/scrambles worksheet contents. Because the resulting cell contents are random characters, sometimes Excel tries to reinterpret my values as dates, etc. This is bad.
To prevent this, I am adding a single quote to the beginning of every encrypted cell value. I need to make sure that when I go to decrypt each cell value, referring to c.formula will strip that quote off for me EVERY time.
VBAjedi
If a cell contains the value 'some string and I set range object "c" to equal that cell, it appears that when I refer to c.formula it ignores/strips off the leading quote. Is this always true? For example:
Code:
Range("A1").value = "'some string"
Set c = Range("A1")
x = c.Formula
WHY (if you care):
I coded an add-in that encrypts/scrambles worksheet contents. Because the resulting cell contents are random characters, sometimes Excel tries to reinterpret my values as dates, etc. This is bad.
To prevent this, I am adding a single quote to the beginning of every encrypted cell value. I need to make sure that when I go to decrypt each cell value, referring to c.formula will strip that quote off for me EVERY time.
VBAjedi