I'm want to use tables and column names when using index/match with vba. I can get my formula to work when I enter a fixed range like this:
But what I want to do is replace the ranges above (in the For loop) to reference the columns within my table (apolloProcessed).
What am I missing, please?
VBA Code:
Sub NotAckMe()
Dim sourceTbl, apolloProcessed As ListObject
Dim apollo As Worksheet
Dim sourceRows As Integer
Dim estimator, b As String
Set apollo = Worksheets("Apollo Processed")
Set apolloProcessed = apollo.ListObjects("q_ApolloProcessed")
Set sourceTbl = mySource.ListObjects("tblNotAcknowledged")
sourceRows = sourceTbl.DataBodyRange.Rows.Count
For r = 5 To sourceRows + 4
estimator = mySource.Cells(r, 2)
b = Application.WorksheetFunction.Index(apollo.Range("G3:G121"), Application.WorksheetFunction.Match(estimator, apollo.Range("B3:B121"), 0))
Next r
End Sub
But what I want to do is replace the ranges above (in the For loop) to reference the columns within my table (apolloProcessed).
What am I missing, please?