ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   decimal number convert to 16bit binary (https://www.excelbanter.com/excel-programming/371846-decimal-number-convert-16bit-binary.html)

Peter Cheang[_2_]

decimal number convert to 16bit binary
 
My column A fill with decimal numbers, I want it to be converted 16 bit
binary and each binary bit go to each column. Anybody can give some
teach,thanks.

NickHK

decimal number convert to 16bit binary
 
Peter,
Here's one way :
Dim i As Long

With ActiveCell
For i = 0 To 15
.Offset(0, 16 - i).Value = -1 * ((.Value And 2 ^ i) 0)
Next
End With

NickHK

"Peter Cheang" wrote in message
...
My column A fill with decimal numbers, I want it to be converted 16 bit
binary and each binary bit go to each column. Anybody can give some
teach,thanks.




Carim

decimal number convert to 16bit binary
 
Hi Peter,

See following post
http://groups.google.com/group/micro...359b5b2c94d1c6

HTH
Cheers
Carim



All times are GMT +1. The time now is 10:02 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com