VBA alternative to Index/Match/CountaA

Charmwah

Board Regular
Joined
Jan 23, 2017
Messages
64
Hi all

I'm trying to find a way to create an alternative to a longwinded INDEX/MATCH/COUNTA formula in VBA, in the hope that the VBA simplifies the process, or at least has a more straightforward way of achieving the same end. The requirement of the formula is to lookup all entries in a database that match the chosen lookup value (from a drop down list) and then return the customer with the matching entry, with all matching entries being listed. At present the results are displayed within the worksheet in descending rows. But i'm thinking that this whole process would be just as easy to set up in a UserForm.

The database looks like the below, with the exception that the 'product group' cells are merged (so only one of each type):

Product Group AProduct Group AProduct Group AProduct Group BProduct Group BProduct Group BProduct Group CProduct Group CProduct Group C
Variant A1Variant A2Variant A3Variant B1Variant B2Variant B3Variant C1Variant C2Variant C3
Customer AYesYesYesYesYes
Customer BYesYesYesYes
Customer CYesYes
Customer DYesYesYesYesYesYes

<tbody>
</tbody>


My formula is as follows:

=IFERROR(OFFSET(OtherDB!$A$3,SMALL(IF(OFFSET(OtherDB!$A$3,1,INDEX(OtherList!$A$2:$A$161,MATCH($C$3,ProdListOther,0)),COUNTA(OtherDB!$A$4:$A$13),1)<>"",ROW(OtherDB!$A$4:$A$13),""),ROW()-ROW($F$3))-3,0),"")

'OtherDB!' is the database, 'OtherList!' is the crib list the makes the search work.

Can anybody point me in the right direction at all in terms of a workable VBA solution?

Thanks in advance!
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.

Forum statistics

Threads
1,214,780
Messages
6,121,527
Members
449,037
Latest member
tmmotairi

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