Public enum eLogLocations
inListBox = 2&
inDebug = 4&
inFile = 8&
Everywhere = inListBox & inDebug & inFile
end enum
I use numbers directly but same error... and the overflow come from the if evaluation not what after Then
The overflow occurs only when bitand return 0 I think. When debugging on this line, running the same line in debug windows never overflow. When using Everywhere or inFile never overflow.
as 4 = 100
and 8 = 1000
result= 0000
Another weird thing ! As bit manipulation must be held against integral type BUT the Bitand function takes two double as parameters and return also a double ?!?
Maybe I just missunderstood bitand usage...

Everywhere = inListBox Or inDebug Or inFileie 1110 = 14&is the string concatenation operator.WorksheetFunction.Bitand(8, 4)(as is) in VBA gives you 'Overflow'? this is not the case for me; time to restart EXCEL or re-boot. Also you might meanEverywhere = inListBox OR inDebug OR inFile