LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default How 2 use right shift "<<" and left shift "" operator in excel?

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


"v-2ajpau" wrote in message
...
How 2 use right shift "<<" and left shift "" operator in
excel?



 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Text "comparison" operator for "contains" used in an "IF" Function Pawaso Excel Worksheet Functions 4 April 4th 23 11:35 AM
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
2007 - Column unhide in Excel does not work i.e. "Ctrl+shift+)" MikeElstonJones Excel Discussion (Misc queries) 3 November 28th 07 12:42 PM
HELP on "left","right","find","len","substitute" functions serene83 Excel Discussion (Misc queries) 5 June 27th 06 02:23 AM
Insert 19 cells "Shift to the right" if cell contains "-" robertjtucker[_4_] Excel Programming 5 July 25th 05 04:20 PM


All times are GMT +1. The time now is 06:57 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"