|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
原附件中已经有根据C列药品增加,自动可在M列生成拼音首字母的。- Private Sub Worksheet_Change(ByVal Target As Range)
- If Target.Count > 1 Then Exit Sub
- If Target = "" Then GoTo 100
- If Target.Column <> 3 Or Target.Row < 2 Then Exit Sub
- Dim aa$
- aa = Target.Value
- Target.Offset(0, 10) = HzToPy(aa, , False, True, True)
- Target.Offset(0, 10) = Target.Offset(0, 10).Value
- Exit Sub
- 100:
- Application.EnableEvents = False
- Target.Offset(0, 10) = ""
- Application.EnableEvents = True
- End Sub
复制代码 |
|