none
Ms Excel move automatically without pressing Enter or Tab RRS feed

  • Question

  • Hi, I wonder if it is possible to make Ms Excel move automatically without pressing Enter or Tab  to the next cell once a certain number of digits is entered, for example, I'm using a barcode scanner to scan a barcode of 13 digits, so I want Excel to move to the next cell once the barcode is scanned.

    example: I'm In cell A1,  this code appeared after scanning "AABB1234567CC", I want Excel to move to A2 in order to scan the next barcode.
    Tuesday, September 16, 2014 12:24 PM

Answers

  • Hi,

    Thanks for posting in MSDN forum.

    >>I'm using a barcode scanner to scan a barcode of 13 digits, so I want Excel to move to the next cell once the barcode is scanned.<<

    Did you write code to set the barcode to the cell?

    If yes, we can move the active cell after the cell set. Here is the code to move down the active cell for your reference:

    ActiveCell.Offset(1, 0).Select

    If no, I suggest that you confirm with the vendor of barcode scanner whether it can be added a message after the barcode to simulate Enter pressing.

    Hope it is helpful.

    Best regards

    Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, September 17, 2014 2:16 AM
    Moderator
  • You can try

    Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)

    If(len(Target.Value) = 13 ) then

        Target.Offset(1,0).Select

    end if

    End Sub

    You do need to put that in the code for the worksheet itself and not just in a module.  TO do that, in the VBA Editor right click on "ThisWorkBook" and select view code (the name may be

    But that will only work if it commits the change.   I couldn't find an event for key pressed which would probably work better.  

    Wednesday, September 17, 2014 2:38 AM

All replies

  • I don't think so.

    Without your input being validated, none of your events will be triggered.

    Tuesday, September 16, 2014 12:39 PM
  • Hi,


    I'm using a barcode scanner to scan a barcode of 13 digits, so I want Excel to move to the next cell once the barcode is scanned.

    Tuesday, September 16, 2014 12:42 PM
  • Hi,

    Thanks for posting in MSDN forum.

    >>I'm using a barcode scanner to scan a barcode of 13 digits, so I want Excel to move to the next cell once the barcode is scanned.<<

    Did you write code to set the barcode to the cell?

    If yes, we can move the active cell after the cell set. Here is the code to move down the active cell for your reference:

    ActiveCell.Offset(1, 0).Select

    If no, I suggest that you confirm with the vendor of barcode scanner whether it can be added a message after the barcode to simulate Enter pressing.

    Hope it is helpful.

    Best regards

    Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, September 17, 2014 2:16 AM
    Moderator
  • You can try

    Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)

    If(len(Target.Value) = 13 ) then

        Target.Offset(1,0).Select

    end if

    End Sub

    You do need to put that in the code for the worksheet itself and not just in a module.  TO do that, in the VBA Editor right click on "ThisWorkBook" and select view code (the name may be

    But that will only work if it commits the change.   I couldn't find an event for key pressed which would probably work better.  

    Wednesday, September 17, 2014 2:38 AM