Problem with match index formula when using variables with wildcard

WednesdayC

Board Regular
Joined
Nov 7, 2010
Messages
201
Office Version
  1. 2016
Platform
  1. MacOS
Hi All


Can anyone help me please, as I have been trying to sort this out for ages, with no success.

Code:
strName = ActiveCell.Value

strName = Left(strName, 10)

ActiveCell.Offset(, -5).Formula = _
        "=IFERROR(INDEX('[TEMP.xlsb]MASTER'!$A:$A,MATCH(TRIM(""* Adele*""),'[TEMP.xlsb]MASTER'!$B:$B,0)),"""")"

   
ActiveCell.Offset(, -5).Formula = _
    "=iferror(INDEX('[TEMP.xlsb]MASTER'!$A:$A,MATCH((""*"" &  strName & ""*""),'[TEMP.xlsb]MASTER'!$B:$B,0)),"""")"

The formula when I use the hard coded value is working, but nothing I have tried is working with the variable, and I do need the wildcards.

I would be very grateful for any help.

Thank you in advance

Regards

Wednesday
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result

Forum statistics

Threads
1,214,376
Messages
6,119,174
Members
448,870
Latest member
max_pedreira

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