Excel altering VBA inserted formula

Yez

New Member
Joined
Nov 7, 2023
Messages
4
Office Version
  1. 365
Platform
  1. Windows
Hello brilliant people,
I am working on a set of utility macros and this one little thing is nagging me. (Ok, lets be honest, theres a ton of things, but this is the one I need help with)
I have VBA adding a table, and then adding a formula referencing an entire column of that table.
VBA Code:
Set tbl = ws.ListObjects.Add
    tbl.Name = "tErrors"
    tbl.HeaderRowRange.Cells(1, 1).Value = "Errors"
. . . adding stuff to the table code

ws.Range("F1").Formula = "=tErrors[Errors]"
ActiveWorkbook.Names.Add Name:="ErrorsList", RefersTo:="='Error Handling'!$F$1#"

It works great except for one tiny thing.
The formula in the cell is =tErrors[@Errors]

That pesky @ symbol is being added automagically autostupidly.

Is there a way to force Excel to leave my formula alone?

Thanks in advance! You guys are the best.

Yez
 
Try....
Rich (BB code):
ws.Range("F1").Formula2 = "=tErrors[Errors]"
 
Upvote 0
Solution

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