Function btoh(s As String)As String
Dim i As Integer, s1 As String, t As Integer
Dim str As String, j As Integer
str="0123456789ABCDEF"
i= Len(s)
Do While i >=1
If ① Then
s1= Mid(s, i-3, 4)
Else
s1 = Mid(s; 1, i)
End If
t=0
For j =1 To Len(s1)
t= ②
Next j
btoh = Mid(str, t + 1, 1)+btoh
i=i-4
Loop
End Function
① ②