Skybluekid
Well-known Member
- Joined
- Apr 17, 2012
- Messages
- 1,230
- Office Version
- 365
- Platform
- Windows
Hi All,
In Column D of a sheet I enter a Charge Reference, for example CL12346. This relates to an Authority which I put in Column I. What I would like to do is everytime i enter a new reference it will put the appropriate Authority in Column I. I have worked out the code for the Lookup,
Sub LookupV()
Dim LU As String
Dim Auth As Variant
On Error Resume Next
LU = Left(Sheets("Data Sheet").Range("D3").Value, 2)
Auth = WorksheetFunction.VLookup(LU, [AuthorityTable], 2, 0)
Sheets("Data Sheet").Range("I3") = Auth
End Sub
I am not sure how to embed this so that it would work everytime I enter a new line.
Thanks in advance
In Column D of a sheet I enter a Charge Reference, for example CL12346. This relates to an Authority which I put in Column I. What I would like to do is everytime i enter a new reference it will put the appropriate Authority in Column I. I have worked out the code for the Lookup,
Sub LookupV()
Dim LU As String
Dim Auth As Variant
On Error Resume Next
LU = Left(Sheets("Data Sheet").Range("D3").Value, 2)
Auth = WorksheetFunction.VLookup(LU, [AuthorityTable], 2, 0)
Sheets("Data Sheet").Range("I3") = Auth
End Sub
I am not sure how to embed this so that it would work everytime I enter a new line.
Thanks in advance