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,复制程序到右侧即可.可以根据需要改变列,或增加改变的字母
如果只对单个这样的要求是好做,但有很多,有点难度,当然也是可以做的
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
excel有这个功能么?
搜狗输入法倒是可以。