Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim i, k As Integer
Dim a As String
For i = 1 To Len(TextBox1.Text)
a = Mid(TextBox1.Text, i, 1)
TextBox2.Text = jm(a, 3)
Next
End Sub
Public Function jm(ByVal n As String, ByVal k As Integer) As String
Dim stemp As Integer
Select Case n
Case "A" To "Z"
If k > 0 Then
stemp = Asc(n) + k
If stemp > 90 Then
stemp -= 26
End If
Else
stemp = Asc(n) + k
If stemp < 65 Then
stemp += 26
End If
End If
End Select
End Function