VBA doesn't have any bit shift operators. You can replicate bit
shifts by multiplying or dividing by the appropriate power of 2.
Function ShiftLeft(Num As Long, Places As Integer) As Long
ShiftLeft = Num * (2 ^ Places)
End Function
Function ShiftRight(Num As Long, Places As Integer) As Long
ShiftRight = Num \ (2 ^ Places)
End Function
Note that there is no error checking in these procedures.
--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com