EXCEL中如何实现同一单元格中输入字母输出对应汉字(指定内容)。 例:A1中输入“BG”,回车后A1显示“办公

2025-01-29 08:58:39
推荐回答(4个)
回答1:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 1 Then '只有当在A列输入数据时改变
Select Case Target.Text
Case "BG"
Target = "办公"
Case "JT"
Target = "交通"
End Select
End If
End Sub
---
工具-宏-编辑VB,复制程序到右侧即可.可以根据需要改变列,或增加改变的字母

回答2:

如果只对单个这样的要求是好做,但有很多,有点难度,当然也是可以做的

回答3:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count = 1 Then
If Target.Column = 5 Then '指定第5列

If Target = "BG" Then Target = "办公"
if target ="xx" then target ="xxx"
if target ="xx" then target ="xxx"
if target ="xx" then target ="xxx"
if target ="xx" then target ="xxx"
...
End If
End If
End Sub

回答4:

excel有这个功能么?
搜狗输入法倒是可以。