C
cghersi
Hi.
I'm facing up the following issue: in a sheet there's a matrix of
boolean values (TRUE, FALSE) that I have to read/write via vba.
Sometimes (not deterministically), a statement like:
if Cells(2,4).value then
' do something
else
' do something else
end if
returns a type mismatch because it reads the cell as string and not as
boolean (obviously in Cells(2,4) there is a TRUE value).
This behaviour doesn't always happen, only sometimes (non
deterministically, as previously said).
The solution that I've thought to is to force the format of the cell
as boolean, bu I don't know how.
Any ideas? or anything else?
unfortunately the application must be language independent, so I
cannot use a comparison like
if Cells(2,4).value = "TRUE" then ...
Moreover, I would like not ot use parsing function (like CBool)
because the performance get worse and worse, and this is another
issue...
thank u very much
bye
CRI
I'm facing up the following issue: in a sheet there's a matrix of
boolean values (TRUE, FALSE) that I have to read/write via vba.
Sometimes (not deterministically), a statement like:
if Cells(2,4).value then
' do something
else
' do something else
end if
returns a type mismatch because it reads the cell as string and not as
boolean (obviously in Cells(2,4) there is a TRUE value).
This behaviour doesn't always happen, only sometimes (non
deterministically, as previously said).
The solution that I've thought to is to force the format of the cell
as boolean, bu I don't know how.
Any ideas? or anything else?
unfortunately the application must be language independent, so I
cannot use a comparison like
if Cells(2,4).value = "TRUE" then ...
Moreover, I would like not ot use parsing function (like CBool)
because the performance get worse and worse, and this is another
issue...
thank u very much
bye
CRI