' Clear a bit in a value'' NOTE: requires Power2()Function BitClear(ByVal value As Long, ByVal bit As Long) As Long ' simply AND with the negation of the bit mask ' Range checking is performed in Power2() BitClear = (value And Not Power2(bit))End Function