在工作表标签上点鼠标右键,选“查看代码”,把下面代码粘贴进去就可以使用了。你在工作表中输入一些句子试试吧。
Private Sub Worksheet_Change(ByVal Target As Range)
Dim t As String
t = Target.Value
If Left(t, 1) = "。" Or Left(t, 1) = "." Then
MsgBox "开头出现句号,下面会自动删除句号"
Target.Value = Right(t, Len(t) - 1)
End If
If Right(t, 1) = "“" Or Right(t, 1) = "”" Or Right(t, 1) = """" Then
MsgBox "结尾出现引号,下面会自动删除引号"
Target.Value = Left(t, Len(t) - 1)
End If
End Sub