logo
search
VBA & Macro Problems

How to Stop Excel VBA from Adding the @ Operator to Formulas

Kushani NimanthikaKushani Nimanthika Oct 10, 2026 871 views

Question details

The user needs to prevent Excel VBA from automatically inserting the @ (implicit-intersection) operator into spreadsheet formulas assigned via macro code.

How to Stop Excel VBA from Adding the @ Operator to Formulas
Product
Excel
Device & OS
not provided
Scenario
Writing formulas to cells using VBA macros in modern dynamic-array versions of Excel.
Observed behavior
Excel alters the intended formula behavior by automatically inserting the @ operator, or interprets terms as named ranges unexpectedly.
Before you start

Ensure you have access to the Developer tab and the VBA Editor, and make a backup copy of your current macro code before modifying property names.

Solution 1Recommended

Use the Formula2 Property in VBA

Assign formulas using the Formula2 property to ensure dynamic-array formulas evaluate correctly without triggering implicit intersection.

In modern versions of Excel that support dynamic arrays, the traditional .Formula property evaluates formulas under legacy rules, which triggers implicit intersection and automatically adds the @ operator. Using the .Formula2 property bypasses this legacy behavior, inserting the formula exactly as intended.

1
Open the VBA Editor

Press Alt + F11 on your keyboard to open the Visual Basic for Applications (VBA) Editor.

2
Locate Your Formula Code

Find the line of macro code where you assign the formula to a cell or range, such as Range("A1").Formula = "=UNIQUE(B1:B10)".

3
Change to Formula2

Replace the .Formula property with .Formula2. For example, modify the code to Range("A1").Formula2 = "=UNIQUE(B1:B10)".

4
Run and Verify

Run your macro and check the target cell in your worksheet. The formula should now appear without the @ operator.

Use the Formula2 Property in VBA
Version Compatibility: The Formula2 property is specific to modern versions of Excel (Excel 365 and Excel 2021) that feature dynamic array support.
Free Microsoft Office alternative

Experience Seamless Spreadsheet Management with WPS Office

If complex macro quirks like the implicit-intersection operator are slowing down your workflow, consider trying WPS Office. It provides a lightweight, intuitive spreadsheet environment that handles everyday data processing effortlessly.

  1. 1. Download the Suite: Visit the official WPS Office website to download the free installation package.
  2. 2. Open Your Spreadsheets: Launch WPS Spreadsheet and open your existing Excel workbooks immediately.
  3. 3. Process Data Effortlessly: Manage your formulas, data analysis, and reports in a familiar layout with a seamless experience.
Highly compatible with Microsoft Excel formats (.xlsx) and macro-enabled workbooks (.xlsm).Avoids the clutter of legacy formula behaviors with a clean, user-friendly interface.Lightweight installation ensures fast startup times and smooth performance.Completely free to download and use for your essential spreadsheet tasks.
microsoft office alternative - wps office

Frequently Asked Questions

Why does Excel automatically add the @ symbol to my macros?

In versions of Excel supporting dynamic arrays, the @ symbol represents the implicit intersection operator. Excel inserts it automatically when you use the legacy .Formula property in VBA to ensure the formula behaves like it would in older non-dynamic array versions of Excel.

What is the difference between Formula and Formula2 in VBA?

The .Formula property processes formulas using older Excel logic, adding the @ operator to prevent arrays from spilling over multiple cells. The .Formula2 property processes formulas using modern dynamic-array logic, allowing results to spill naturally without adding the @ symbol.

Can I use a VBA macro to remove the @ symbol after it is added?

Yes, you can write an additional macro script to find and replace the '@' character in your worksheet formulas. However, using the .Formula2 property from the start is highly recommended because it is cleaner and more efficient.