I have the following piece of VBA code which is inserting a formula into a column on one of my worksheets. The formula works fine when used in Excel normally (without inserting it using VBA), however when I insert it using the VBA code, Excel is automatically adding @ operators which are causing the formula to return an error value every time. If I manually remove the @ operators from the formula which has been created in the sheet by, the formula works again.
How do I ensure these @ operators are either not automatically added? Or how do I change what I'm doing so the @ operators don't cause issues?
FYI, the formula is a simple index-match formula to match variables to a master table in order to return the SKU (unique code) for the item. The master table is on a tab named 'SKU', and the variables to match are on the 'Received - Open' tab.
Worksheets("Received - Open").Range("AG2:AG" & lastrow).Formula = "=INDEX(SKU!$A$2:$G$10000,MATCH('Received - Open'!AK2&'Received - Open'!J2&'Received - Open'!AH2&'Received - Open'!AI2&'Received - Open'!AC2,SKU!$C$2:$C$10000&SKU!$D$2:$D$1000&SKU!$E$2:$E$1000&SKU!$F$2:$F$1000&SKU!$G$2:$G$1000,0),1)"
Many thanks in advance!