View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Michel Pierron Michel Pierron is offline
external usenet poster
 
Posts: 214
Default Convert Binary to Hex

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?