nightwing37
New Member
- Joined
- Jun 6, 2019
- Messages
- 1
I am writing a macro in VBA for an excel spreadsheet to manage barcode sign ins for a summer camp program.
Column A is Last Name
Column B is First Name
Column C is ID Number
All other columns will be alternating between AM check-in and PM check-in
This issue I am having that, upon scanning, the barcode value fills in the Active Cell, but fails to:
Update the first available cell in the same Row as the intersection of the Barcode Value and the existing Column C values
Here is what I have so far:
Column A is Last Name
Column B is First Name
Column C is ID Number
All other columns will be alternating between AM check-in and PM check-in
This issue I am having that, upon scanning, the barcode value fills in the Active Cell, but fails to:
Update the first available cell in the same Row as the intersection of the Barcode Value and the existing Column C values
Here is what I have so far:
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim thisRow As Long
Dim thisColumn As Long
Dim goTime As Long
goTime = 0
With Application
.EnableEvents = False
.ScreenUpdating = False
Intersect(Target, Range("C:C")).Activate
thisRow = ActiveCell.Row
thisColumn = ActiveCell.Column
While goTime < 1
If Cells(thisRow, thisColumn) = vbEmpty Then
Cells(thisRow, thisColumn) = Format(Now, "mm/dd/yy h:mm:ss")
goTime = goTime + 1
Else
thisColumn = thisColumn + 1
End If
Wend
.EnableEvents = True
.ScreenUpdating = True
End With
End Sub