I want to convert from "a" to "1" or from "b" to "2" with function.
I'm new with VB, please give me an Idea about this problem.
Thank you in advance.
Of couse this code not work, but that's just my idea about function.
I'm new with VB, please give me an Idea about this problem.
Thank you in advance.
Code:
a1="a"
a1 = fac(a1)
MsgBox (a1)
'if a1="a" it should be "1"
a2="b"
a2 = fac(a2)
MsgBox (a2)
'if a2="b" it should be "2"
Function fac(t) As String
If t = "a" Then
t = "1"
End If
If t = "b" Then
t = "2"
End If
End Function
Of couse this code not work, but that's just my idea about function.