How do I bitwise shift left and right

R

Ryan

I have an integer where I want to shift the bits to the
left or to the right.

What is the VBA command to do that?

My integer is e.g.: 0000 0010 0000 0000
I want it to shift to: 0000 0100 0000 0000
 
A

Allen Browne

Would this be just a matter of multiplying or dividing by a power of 2?

The exponentiation operator is ^.
The integer division operator is \.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top