Drewster66
New Member
- Joined
- Jun 3, 2019
- Messages
- 6
I really enjoyed your tutorial on Excel Reverse lookup (https://youtu.be/mIht6gICsS4) but Im wanting to convert it from a function to a Sub Routine and getting HEAPS of erros {its obvioulsy not just a matter of removeing Function() and replacing with Sub()}.
Is anyone able to assist with this at all, Thank you in advance.
I have posted the working code below:
Function RL(TruckValue As Range, LooKupTable As Range)
HRow = LooKupTable.Rows(1).Row - 1
HCol = LooKupTable.Columns(1).Column - 1
RL = ""
For Each cell In LooKupTable
If cell.Value = TruckValue.Value Then
RL = RL & Cells(HRow, cell.Column).Value
End If
Next cell
End Function
Is anyone able to assist with this at all, Thank you in advance.
I have posted the working code below:
Function RL(TruckValue As Range, LooKupTable As Range)
HRow = LooKupTable.Rows(1).Row - 1
HCol = LooKupTable.Columns(1).Column - 1
RL = ""
For Each cell In LooKupTable
If cell.Value = TruckValue.Value Then
RL = RL & Cells(HRow, cell.Column).Value
End If
Next cell
End Function