I would like to be able to use application.worksheetfunction.vlookup to define row values.
I am receiving an object defined error on the line that I am using to set a range value for the table that is used in the vlookup.
The error is showing up on the line below within the context further below. I would like to select both rows as the table range.
I am receiving an object defined error on the line that I am using to set a range value for the table that is used in the vlookup.
The error is showing up on the line below within the context further below. I would like to select both rows as the table range.
Code:
TblRng = .Range("A:A,B:B")
Code:
For aa = 1 To samples
sampleVar = wkbk.Sheets("AllDistanceMeasures").Cells(aa + 4, 11).value
With Workbooks(COMBINED).Worksheets(Contract)
TblRng = .Range("A:A,B:B")
sampleSet = Application.WorksheetFunction.VLookup(sampleVar, TblRng, 2, False)
RowVar = .sampleSet.Row
RowRange = .Cells(RowVar, 1)
End With
Workbooks(COMBINED).Worksheets(Contract).Activate.Range(RowRange, RowRange.End(xlToRight)).Copy
Workbooks("KMEANS_TEMPLATE.xls").Sheets("Destination").Cells(aa + 8, 4).PasteSpecial xlPasteValues