Private Sub Command2_Click()
Dim a(100) As String
num = (InputBox("请输入十进制整数"))
r = Val(InputBox("请输入进制:2~16"))
i = 1
While num <> 0 a(i) = num Mod r i = i + 1 num = num \ r
Wend
For j = i To 1 Step -1 s = s & a(j)
Next
Print s
End Sub
常用的进制只有2,8,16,这个代码可以实现2,8的转换,
16进制需要A,B,C,D,E,F,按这个思路再加些代码即可