inseriscilo in un form in cui hai messo un commandbutton e un textbox
inserisci dei numeri nella textbox e poi pigia il commandbutton
divertiti

Private Sub Code3of9(sToCode As String, pPaintInto As Form, Y1 As Long, Y2 As Long)
Dim sValidChars As String, sValidCodes As String
Dim lElevate As Integer
Dim lCounter As Long, lWkValue As Long, PosX As Long, PosY1 As Long, PosY2 As Long
Dim TPX As Long

TPX = Screen.TwipsPerPixelX

sValidChars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%*"
sValidCodes = "41914595664727860970419025962647338417105957" + _
"84729059950476626106644590602984801043246599" + _
"62476744460260046477586109044686603224803443" + _
"91860130478424477058030365265828235758580903" + _
"65863556658042365383495434978353624150635770"

sToCode = UCase(IIf(Left(sToCode, 1) = "*", "", "*") + sToCode + IIf(Right(sToCode, 1) = "*", "", "*"))
PosX = ((((Me.Width / TPX) - (Len(sToCode) * 16)) / 2) * TPX) - 1
PosX = PosX - 180
PosY1 = Y1 'PosY1 = pPaintInto.Height * 0.2
PosY2 = Y2 'PosY2 = pPaintInto.Height * 0.8

If PosX < 0 Then
MsgBox "The length of the code exceeds control limits.", vbExclamation, "Large string"
GoTo End_Code
End If

On Error Resume Next

For lCounter = 1 To Len(sToCode)
'Here is where the number is fetched from the sValidCodes string. It will get only 5 digits.
lWkValue = Val(Mid(sValidCodes, ((InStr(1, sValidChars, Mid(sToCode, lCounter, 1)) - 1) * 5) + 1, 5))
lWkValue = IIf(lWkValue = 0, 36538, lWkValue)

For lElevate = 15 To 0 Step -1
'It evaluates the binary number to see if it has to draw a line.
If lWkValue >= 2 ^ lElevate Then
pPaintInto.Line (PosX, PosY1)-(PosX, PosY2)
lWkValue = lWkValue - (2 ^ lElevate)
End If
PosX = PosX + TPX
Next
Next
End_Code:
End Sub

Private Sub Command1_Click()
Call Code3of9(Text1.Text, Me, 150, 1050)
End Sub