I have a Excel sheet. with the following basic lay out....
[TABLE="width: 786"]
<tbody>[TR]
[TD="width: 87, align: center"] A[/TD]
[TD="width: 123, align: center"] B[/TD]
[TD="width: 145, align: center"]D
[/TD]
[TD="width: 145, align: center"] E[/TD]
[TD="width: 88, align: center"] F[/TD]
[TD="width: 145, align: center"] G[/TD]
[TD="width: 123, align: center"] I[/TD]
[TD="width: 64, align: center"] J[/TD]
[/TR]
[TR]
[TD] 0002841124[/TD]
[TD="align: center"] Jane Doe[/TD]
[TD="align: center"] 0002841109[/TD]
[TD="align: center"] 08 March 2016[/TD]
[TD="align: center"] 22:07:53[/TD]
[TD="align: center"] Class 73[/TD]
[TD="align: center"] Jane Doe[/TD]
[TD="align: center"] 0[/TD]
[/TR]
</tbody>[/TABLE]
To explain. Column 'A' is an input from an RFID card reader. Column 'B' a name assigned to that card. This is my dynamic lookup table.
Column 'D' is now the Card being used by person assigned. Column 'E' gives the date. 'F' the time.
Where 'D' is is used to create 'E' and 'F' by a basic VBA script (below)..
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 4 Then
Cells(Target.Row, 5).Value = Date
Cells(Target.Row, 6).Value = Time
Beep
End If
End Sub
However, I have no idea as to how I can copy into 'G' the name assigned to that card. And as other cards get used, they follow the same process in column format.
At the moment I have a macro =IF(D2="";"";VLOOKUP($D2;$A:$B;2;FALSE)) This reads input from 'D' and looks up a match in 'A' to return name from 'B'. Otherwise show nothing in a call. But this is a dynamic requirement on a manual copy and past of the macro and not what I want happening.
Ideally this would be a VBA solution. I have no idea about.
Column 'I' is meant to mirror column 'B' as it's populated. Or show an empty cell if nothing is found in 'B'..
=IF(D2="";"";VLOOKUP($D2;$A:$B;2;FALSE))
Column 'J' counts the number of times name uses card in the day. Or show nothing if no card is used ..
=IF(D2="";"";VLOOKUP($D2;$A:$B;2;FALSE))
Yes a tad odd in terms of logic. But sort of works. I just need to know to either convert this to VBA or lock the macro from being deleted as they are developed dynamically.
Can any body offer ideas please?
Thanks for any help and time on my behalf.
[TABLE="width: 786"]
<tbody>[TR]
[TD="width: 87, align: center"] A[/TD]
[TD="width: 123, align: center"] B[/TD]
[TD="width: 145, align: center"]D
[/TD]
[TD="width: 145, align: center"] E[/TD]
[TD="width: 88, align: center"] F[/TD]
[TD="width: 145, align: center"] G[/TD]
[TD="width: 123, align: center"] I[/TD]
[TD="width: 64, align: center"] J[/TD]
[/TR]
[TR]
[TD] 0002841124[/TD]
[TD="align: center"] Jane Doe[/TD]
[TD="align: center"] 0002841109[/TD]
[TD="align: center"] 08 March 2016[/TD]
[TD="align: center"] 22:07:53[/TD]
[TD="align: center"] Class 73[/TD]
[TD="align: center"] Jane Doe[/TD]
[TD="align: center"] 0[/TD]
[/TR]
</tbody>[/TABLE]
To explain. Column 'A' is an input from an RFID card reader. Column 'B' a name assigned to that card. This is my dynamic lookup table.
Column 'D' is now the Card being used by person assigned. Column 'E' gives the date. 'F' the time.
Where 'D' is is used to create 'E' and 'F' by a basic VBA script (below)..
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 4 Then
Cells(Target.Row, 5).Value = Date
Cells(Target.Row, 6).Value = Time
Beep
End If
End Sub
However, I have no idea as to how I can copy into 'G' the name assigned to that card. And as other cards get used, they follow the same process in column format.
At the moment I have a macro =IF(D2="";"";VLOOKUP($D2;$A:$B;2;FALSE)) This reads input from 'D' and looks up a match in 'A' to return name from 'B'. Otherwise show nothing in a call. But this is a dynamic requirement on a manual copy and past of the macro and not what I want happening.
Ideally this would be a VBA solution. I have no idea about.
Column 'I' is meant to mirror column 'B' as it's populated. Or show an empty cell if nothing is found in 'B'..
=IF(D2="";"";VLOOKUP($D2;$A:$B;2;FALSE))
Column 'J' counts the number of times name uses card in the day. Or show nothing if no card is used ..
=IF(D2="";"";VLOOKUP($D2;$A:$B;2;FALSE))
Yes a tad odd in terms of logic. But sort of works. I just need to know to either convert this to VBA or lock the macro from being deleted as they are developed dynamically.
Can any body offer ideas please?
Thanks for any help and time on my behalf.