Hello,
I am having trouble with my code to reference from a table called "jobtype" I have the codes below and the full code below. The Macro runs with "test" text but as soon as I used the formula below of index match.
It just goes on an endless loop. Do I need to define where my table is first before it reads the range of the table since it is in a different sheet?
Application.WorksheetFunction.Index(Range("jobtype[Trade]"), Application.WorksheetFunction.Match(Range(cell3), Range("jobtype[IFS]"), 0))
Supporting code and spread sheet images are below.
Thank you!
I am having trouble with my code to reference from a table called "jobtype" I have the codes below and the full code below. The Macro runs with "test" text but as soon as I used the formula below of index match.
It just goes on an endless loop. Do I need to define where my table is first before it reads the range of the table since it is in a different sheet?
Application.WorksheetFunction.Index(Range("jobtype[Trade]"), Application.WorksheetFunction.Match(Range(cell3), Range("jobtype[IFS]"), 0))
Supporting code and spread sheet images are below.
Thank you!
VBA Code:
Sub IFSVlook()
Dim cell3 As Range
Dim Ifs As Worksheet
Dim LastRow As Long
Set Ifs = ThisWorkbook.Sheets("IFS Upload")
LastRow = Cells(Rows.Count, 1).End(xlUp).Row
For Each cell3 In Worksheets("IFS Upload").Range("N2:N" & LastRow)
On Error Resume Next
If Len(cell3.Value) > 0 Then
cell3.Offset(0, 1) = Application.WorksheetFunction.Index(Range("jobtype[Trade]"), Application.WorksheetFunction.Match(Range(cell3), Range("jobtype[IFS]"), 0))
End If
Next
End Sub