PrepareEdit
'最少有一列有值
If e.Col.Name = "第四列" Then
If IIF(e.Row.IsNull("第一列"), 1, 0) + IIF(e.Row.IsNull("第二列"), 1, 0) + IIF(e.Row.IsNull("第三列"), 1, 0) = 3 Then
e.Cancel = True
End If
End If
'三列都必须有值
If e.Col.Name = "第四列" Then
If IIF(e.Row.IsNull("第一列"), 1, 0) + IIF(e.Row.IsNull("第二列"), 1, 0) + IIF(e.Row.IsNull("第三列"), 1, 0)> Then
e.Cancel = True
End If
End If