Hi,
I am trying to make small improvement in data entry that i have to do almost every day.
Every time when new entry is made I need to capture exact time of that data entry.
What I have for now is file with vba code that is filling cells in column C with actual date and time every time when cell in column B is filled with some data. (if cell in column B is blank than C is also blank)
Code look like this:
I will use barcode scanner to make data entry in columns "A" and "B", scanner is setup to put TAB after every scan so every time it is moving to the cell on the right side.
But when data in column"B" is entered with scanner so time is shown in column "C" and cell in column "C" is selected i would like to move to next row and select cell in column "A" so I can start entering data in new row.
Can you advice how this move can be done? Every help will be highly appriciated.
I am trying to make small improvement in data entry that i have to do almost every day.
Every time when new entry is made I need to capture exact time of that data entry.
What I have for now is file with vba code that is filling cells in column C with actual date and time every time when cell in column B is filled with some data. (if cell in column B is blank than C is also blank)
Code look like this:
Code:
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Dim rCell As Range
Dim rChange As Range
On Error GoTo ErrHandler
Set rChange = Intersect(Target, Range("B:B"))
If Not rChange Is Nothing Then
Application.EnableEvents = False
For Each rCell In rChange
If rCell > "" Then
With rCell.Offset(0, 1)
.Value = Now
.NumberFormat = "mm/dd/yyyy hh:mm:ss"
End With
Else
rCell.Offset(0, 1).Clear
End If
Next
End If
ExitHandler:
Set rCell = Nothing
Set rChange = Nothing
Application.EnableEvents = True
Exit Sub
ErrHandler:
MsgBox Err.Description
Resume ExitHandler
End Sub
I will use barcode scanner to make data entry in columns "A" and "B", scanner is setup to put TAB after every scan so every time it is moving to the cell on the right side.
But when data in column"B" is entered with scanner so time is shown in column "C" and cell in column "C" is selected i would like to move to next row and select cell in column "A" so I can start entering data in new row.
Can you advice how this move can be done? Every help will be highly appriciated.