How to wrap an Excel cursor to save it in a specific range

In Excel, I have three columns:

column1, column2, column3

I enter data into excel using a barcode scanner that is attached to the iPad. A barcode scanner sends ENTERafter each scan. I believe I can install excel, so that ENTERwill lead to the selection of the next column (instead of the next row)

However, I do not know how to do this in the next line after finding ENTERin column3. Right now I have this:

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
    If Target.Column = 3 Then
        If Target.Value = "{enter}" Then
            MsgBox "SDf"
        End If
    End If
End Sub

But it Target.Valuedetects only the row inside the cell; it does not detect what was pressed.

How to get the next line to be selected after it is ENTERdiscovered in column 3?

+5
2

vba.

- . . Select Locked Cells . . .

enter image description here

- excel, Enter . ( Excel 2010) File TAB | Options | Excel Options | Advanced

enter image description here

, , , . . .

enter image description here

+10

, :

Private Sub Worksheet_Change(ByVal Target As Range)

    'named (contiguous) range on input sheet
    Const DATA_NAME As String = "DATA"
    Dim rngData As Range, numCols As Long

    If Target.Cells.Count > 1 Then Exit Sub

    Set rngData = Me.Range(DATA_NAME)
    numCols = rngData.Columns.Count

    If Not Intersect(rngData, Target) Is Nothing Then
        If Target.Column < rngData.Columns(numCols).Column Then
            Target.Offset(0, 1).Select
        Else
            Target.Offset(1, -(numCols - 1)).Select
        End If
    End If

End Sub
+4

All Articles