判断粘贴过来的空单元格数据,并设置错误提示,对有数据的单元格的可以判断后seterror,请问没有数据的如何判断。我是在datacolchanging设置的如下代码
Select Case e.DataCol.Name
Case "xingming"
If e.NewValue IsNot Nothing Then
e.DataRow.SetError("xingming","")
Else
e.DataRow.SetError("xingming","姓名为空!")
End If
Case "xingbie"
If e.NewValue IsNot Nothing Then
If(e.NewValue="男") Or (e.NewValue="女") Then
e.DataRow.SetError("xingbie","")
Else
e.DataRow.SetError("xingbie","性别输入错误!")
e.Cancel=True
End If
Else
e.DataRow.SetError("xingbie","性别为空!")
End If
End Select
不管是高速合并还是直接粘贴
性别为空就判断不了错误
望大神帮指正错误