excel VBA编程题,求高手解答??
发布网友
发布时间:2022-10-08 21:53
我来回答
共4个回答
热心网友
时间:2023-11-18 09:24
不用VB,用公式就行:
B1输入公式如下:
=IF(OR(A1<0,A1>9),"输入无效",CHOOSE(A1+1,"A","B","C","D","E","F","G","H","I","J"))
说明:0~9是10个数,A-I是9个字母,少了一个,以上公式加了一个J.
热心网友
时间:2023-11-18 09:25
b1 =char(65+a1)
VBA:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$1" Then [b1] = Chr(65 + [a1])
End Sub
热心网友
时间:2023-11-18 09:25
Sub Macro1()
For i = 1 To 10
Cells(i, 2) = Chr(65 + Cells(i, 1))
Next i
End Sub
热心网友
时间:2023-11-18 09:26
建立应用数据区 对应0-9到A-I
然后用vlookup函数,不用vb,很方便,至多外套个if函数