excel vba check if string entirely numeric
'VBA language function to check if string is ENTIRELY numeric:
MsgBox IsNumeric(Expression)
excel vba check if string entirely numeric
'VBA language function to check if string is ENTIRELY numeric:
MsgBox IsNumeric(Expression)
excel vba check if bit is set in integer
'Extremely fast VBA function to test if a specified bit is set
'within a 16-bit Integer.
'Bits are numbered from 0 to 15, so the first (least significant) bit
'is bit 0.
'Note: we do not inspect bit 15, the sign bit.
Function IntegerBitIsSet(theInteger%, bit As Byte) As Boolean
Static i&, b%()
If (Not Not b) = 0 Then
ReDim b(0 To 14)
For i = 0 To 14
b(i) = 2 ^ i
Next
End If
If bit < 15 Then IntegerBitIsSet = theInteger And b(bit)
End Function
'------------------------------------------------------------------
MsgBox IntegerBitIsSet(255, 7) '<--displays: True
MsgBox IntegerBitIsSet(230, 0) '<--displays: False
MsgBox IntegerBitIsSet(16384, 14) '<--displays: True
MsgBox IntegerBitIsSet(-16383, 0) '<--displays: True
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us