| |
devguy
Posts: 15
Score: 0
Joined: 7/31/2004
From: USA
Status: offline
|
This should give you an idea... Option Explicit Dim sStr Do sStr = InputBox("Enter string for hex conversion:") If Len(sStr) > 0 Then MsgBox ConvertString(sStr) End If Loop While Len(sStr) > 0 Function ConvertString(ByVal psStr) Dim iChar Dim iX Dim sCvt Dim sHex sCvt = "" For iX = 1 To Len(psStr) iChar = Asc(Mid(psStr, iX, 1)) sHex = Hex(iChar) If Len(sHex) < 2 Then sHex = "0" & sHex End If sHex = Mid(sHex, 2, 1) & Mid(sHex, 1, 1) sCvt = sCvt & sHex Next ConvertString = sCvt End Function
|
|