Hi,

I need to convert a binary string to a hex string.

The code i've got works great but if i want to convert

1111111111111111 i get an overflow.

Thanx Asterix

***********THE CODE I'VE GOT************

Public Function Bin2Dec(Bin) As Integer
Y = Len(Bin) - 1
For X = 1 To Len(Bin)
Bin2Dec = Bin2Dec + ((2 ^ Y)) * (Mid$(Bin, X, 1))
Y = Y - 1
Next X
End Function

Private Sub Command1_Click()
Text2.Text = Hex(Bin2Dec(Text1.Text))
End Sub