View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
Chipmunk Chipmunk is offline
external usenet poster
 
Posts: 7
Default Convert Binary to Hex

Thanks for the response. I opened up the vb editor and pasted in your code.
What do I need to put in the worksheet cell?

Thanks.

"Michel Pierron" wrote:

Hi Chipmunk,

Function BinToHex(Binary As String)
Dim Value&, i&, Base#: Base = 1
For i = Len(Binary) To 1 Step -1
Value = Value + IIf(Mid(Binary, i, 1) = "1", Base, 0)
Base = Base * 2
Next i
BinToHex = Hex(Value)
End Function

MP

"Chipmunk" a écrit dans le message de
news: ...
How to I convert a 32 bit binary number to hex?