Private Sub CheckData(KeyAscii As Integer)
If KeyAscii >= 48 And KeyAscii <= 57 Then Exit Sub '如果是数字退出
If KeyAscii <> 8 Then KeyAscii = 0
End Sub
Private Sub vsflexgrid_KeyPressEdit(ByVal Row As Long, ByVal Col As Long, KeyAscii As Integer)
If col=1 Then '第一列只能输入数字
CheckData KeyAscii
End If
End Sub