Forum Discussion
ecovonrein
Jul 27, 2022Iron Contributor
International nightmare with boolean inputs
I have a static Excel table with records that contain boolean flags. That is, a column populated with values True and False. I wish to assure one of these two values and I hence impose a Data Valid...
ecovonrein
Jul 27, 2022Iron Contributor
Update: The investigation gets weirder by the minute. I skipped a few details in the post above, one being that the flag was also passed thru some VBA code. I could not understand why the VBA code did not puke. And I just ran a test on a German computer:
Public Function haveFun(flag as Variant) as Variant
if flag then
haveFun = "Hello"
else
haveFun = "world"
End Function
I can call =haveFun(WAHR) or =haveFun(TRUE) and get "Hello" in both cases. That is, VBA is indifferent to the input language used.
Do the same thing in native Excel - =if(C5;"Hello";"world") - and we get #WERT! when C5 contains TRUE.
Extraordinary.
I am looking at multiplying the VBA input *1 to assure symmetric behaviour. TRUE*1 blows up in German Excel.