鼠标在单元格出现
记录不能跳行输入
我的代码是如下
谁有类似的或帮我挑挑毛病
rivate Sub SGrid_LeaveCell(ByVal Col As Long, ByVal Row As Long, ByVal NewCol As Long, ByVal NewRow As Long, Cancel As Boolean)
' If SGrid.ActiveRow > lrow Then
' SGrid.Row = SGrid.ActiveRow
' SGrid.Col = SGrid.ActiveCol
' If Len(Trim(SGrid.Text)) <> 0 Then
' lrow = SGrid.ActiveRow
' End If
' End If
'
' Select Case SGrid.ActiveCol
' Case 1, 2, 3, 4
' SGrid.Row = SGrid.ActiveRow
' SGrid.Col = SGrid.ActiveCol
' If Len(Trim(SGrid.Text)) = 0 Then
' SGrid.SetFocus
'' SGrid.Action = 0
' Exit Sub
' End If
' End Select
'End Sub'Private Sub SGrid_LeaveRow(ByVal Row As Long, ByVal RowWasLast As Boolean, ByVal RowChanged As Boolean, ByVal AllCellsHaveData As Boolean, ByVal NewRow As Long, ByVal NewRowIsLast As Long, Cancel As Boolean)
' For i = 1 To NewRow - 1
' SGrid.Row = 1
' SGrid.Col = 1
' If Len(Trim(SGrid.Text)) = 0 Then
' MsgBox "不能为空"
' SGrid.SetFocus
' Exit Sub
' End If
' SGrid.Col = 2
' If Len(Trim(SGrid.Text)) = 0 Then
' MsgBox "不能为空"
' SGrid.SetFocus
' Exit Sub
' End If
' SGrid.Col = 3
' If Len(Trim(SGrid.Text)) = 0 Then
' MsgBox "不能为空"
' SGrid.SetFocus
' Exit Sub
' End If
' SGrid.Col = 4
' If Len(Trim(SGrid.Text)) = 0 Then
' MsgBox "不能为空"
' SGrid.SetFocus
' Exit Sub
' End If
'End Sub
记录不能跳行输入
我的代码是如下
谁有类似的或帮我挑挑毛病
rivate Sub SGrid_LeaveCell(ByVal Col As Long, ByVal Row As Long, ByVal NewCol As Long, ByVal NewRow As Long, Cancel As Boolean)
' If SGrid.ActiveRow > lrow Then
' SGrid.Row = SGrid.ActiveRow
' SGrid.Col = SGrid.ActiveCol
' If Len(Trim(SGrid.Text)) <> 0 Then
' lrow = SGrid.ActiveRow
' End If
' End If
'
' Select Case SGrid.ActiveCol
' Case 1, 2, 3, 4
' SGrid.Row = SGrid.ActiveRow
' SGrid.Col = SGrid.ActiveCol
' If Len(Trim(SGrid.Text)) = 0 Then
' SGrid.SetFocus
'' SGrid.Action = 0
' Exit Sub
' End If
' End Select
'End Sub'Private Sub SGrid_LeaveRow(ByVal Row As Long, ByVal RowWasLast As Boolean, ByVal RowChanged As Boolean, ByVal AllCellsHaveData As Boolean, ByVal NewRow As Long, ByVal NewRowIsLast As Long, Cancel As Boolean)
' For i = 1 To NewRow - 1
' SGrid.Row = 1
' SGrid.Col = 1
' If Len(Trim(SGrid.Text)) = 0 Then
' MsgBox "不能为空"
' SGrid.SetFocus
' Exit Sub
' End If
' SGrid.Col = 2
' If Len(Trim(SGrid.Text)) = 0 Then
' MsgBox "不能为空"
' SGrid.SetFocus
' Exit Sub
' End If
' SGrid.Col = 3
' If Len(Trim(SGrid.Text)) = 0 Then
' MsgBox "不能为空"
' SGrid.SetFocus
' Exit Sub
' End If
' SGrid.Col = 4
' If Len(Trim(SGrid.Text)) = 0 Then
' MsgBox "不能为空"
' SGrid.SetFocus
' Exit Sub
' End If
'End Sub
整个代码都没有注释,谁知道你要达到什么目标?
之前多自己想想办法,你就可以省100分。