View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Jim Thomlinson[_3_] Jim Thomlinson[_3_] is offline
external usenet poster
 
Posts: 983
Default Bit manipulation

That is good for a shift but any idea how you would get any of the other
bitwise operators? I still say you go with C/C++. As an aside to do a bit
shift you should just be able to multiply or divide by 2 which in base 2 will
functionally shift the bits? I think... I am sure you will let me know Bob...
:)

"Bob Phillips" wrote:

Or create your own

Function BitShiftRight(Val As Long, NumBits As Integer) As Long
BitShiftRight = Val * (2 ^ NumBits)
End Function

Function BitShiftLeft(Val As Long, NumBits As Integer) As Long
BitShiftLeft = Val \ (2 ^ NumBits)
End Function


--

HTH

RP
(remove nothere from the email address if mailing direct)


"Jim Thomlinson" wrote in message
...
Nope... nothing direct. You could write a program in C/C++ and call that
program through the shell command. That is probably your best option...

HTH

"Tony" wrote:

Hi all,

Does VBA (Excel 97) have bit manipulation functions -
shiftleft/right etc? I couldn't find anything that looked
promising.

Tony