To all
I have a xls sheet which contains formulas as follows
In cell C1
= If($A$1<> “”, 99,””)
The idea is that a value is written if A1 contains something (i.e. a value) otherwise no value is written. I do not want 0. I want a blank cell
Then in a macro I pick up the value from cell C1 as follows
Dim ValueToUse As Double
ValueToUse = CDbl(CurrentSh.Cells(1, 3).Value)
If Not (IsEmpty(ValueToUse) Then
‘do something
End if
I am having trouble with the “empty” cell, as I get Type Mismatch. Hence my trying to force the value to a Double using CDbl()
Q: Is there a “smart” way of writing nothing in a cell?
The examples are simplified code
Thanks
Regards
JXB
I have a xls sheet which contains formulas as follows
In cell C1
= If($A$1<> “”, 99,””)
The idea is that a value is written if A1 contains something (i.e. a value) otherwise no value is written. I do not want 0. I want a blank cell
Then in a macro I pick up the value from cell C1 as follows
Dim ValueToUse As Double
ValueToUse = CDbl(CurrentSh.Cells(1, 3).Value)
If Not (IsEmpty(ValueToUse) Then
‘do something
End if
I am having trouble with the “empty” cell, as I get Type Mismatch. Hence my trying to force the value to a Double using CDbl()
Q: Is there a “smart” way of writing nothing in a cell?
The examples are simplified code
Thanks
Regards
JXB