VBA : Unable to get the Match property of WorkSheetFunction class

kera404

New Member
Joined
Jun 7, 2016
Messages
8
I have a list of Names in the sheet "ClaimAnalysis", and a subset of these Name Values in the sheet "Analysis". To select the Names that have values in "Analysis1", I used Index-Match function for each value in the column of "ClaimAnalysis" (frow is the count of total rows in "ClaimAnalysis"). The formula I am applying works fine manually Formula Bar but throws 'runtime error in VBA.

Formula Bar "=INDEX(Analysis1!$B$2:$B$717,MATCH(ClaimAnalysis!A2,Analysis2!$A$2:$A$727,0))"

and yes variable frow makes my range as per desired in formula bar

Code:
For x = 2 To frow - 1        ThisWorkbook.Sheets("ClaimAnalysis").Cells(x, 2).Value = _
            Application.WorksheetFunction.Index(Sheets("Analysis1").Range("B2").End(xlDown), Application.WorksheetFunction.Match(ThisWorkbook.Sheets("ClaimAnalysis").Cells(x, 1), Sheets("Analysis1").Range("A2").End(xlDown), 0))
    Next x
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
Try this:
[CODE​]ThisWorkbook.Sheets("Analysis1").Range("A2").End(xlDown)[/CODE]
 
Upvote 0
Code:
Sheets("Analysis1").Range("A2").End(xlDown)

This returns a single cell and not a lookup range.

WBD
 
Upvote 0

Forum statistics

Threads
1,216,095
Messages
6,128,790
Members
449,468
Latest member
AGreen17

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top