Hoping you can help me out with something that I think is going to be pretty simple.
I'm using a Mac with 365
If I enter the following directly into in an Excel cell it works fine.
=XLOOKUP(IFERROR(INDEX($Q$2:$Q$210,MATCH(1,COUNTIF(D2,"*"&$Q$2:$Q$210&"*"),0)),""),$Q$2:$Q$210,$R$2:$R$210,"")
Using VBA I've been trying to enter the formula into an Excel cell but I can't get it to work.
For the wildcard values VBA kept adding spaces either side so I added " quotes which seem like they have solved the space problem e.g. " * " needs ""*"" to get rid of the extra space vba is putting in.
However I still can't enter the formula into a cell e.g.
Range("F2").formula ="= etc. fails with method formulation of object 'Range' failed
Range("F2").select
ActiveCell.formula ="= etc. fails with an error.
I don't know why VBA is compiling the code when all I want to do is enter the formula into an Excel cell.
I'd appreciate your help. Thanks
I'm using a Mac with 365
If I enter the following directly into in an Excel cell it works fine.
=XLOOKUP(IFERROR(INDEX($Q$2:$Q$210,MATCH(1,COUNTIF(D2,"*"&$Q$2:$Q$210&"*"),0)),""),$Q$2:$Q$210,$R$2:$R$210,"")
Using VBA I've been trying to enter the formula into an Excel cell but I can't get it to work.
For the wildcard values VBA kept adding spaces either side so I added " quotes which seem like they have solved the space problem e.g. " * " needs ""*"" to get rid of the extra space vba is putting in.
However I still can't enter the formula into a cell e.g.
Range("F2").formula ="= etc. fails with method formulation of object 'Range' failed
Range("F2").select
ActiveCell.formula ="= etc. fails with an error.
I don't know why VBA is compiling the code when all I want to do is enter the formula into an Excel cell.
I'd appreciate your help. Thanks