VBA adding @ into formula

typody

New Member
Joined
Aug 20, 2021
Messages
11
Office Version
  1. 365
Platform
  1. Windows
Hi,

Can anyone explain why the formula I enter into my VBA code for a cell is inconsistent.

For example the code I have is:

ActiveCell.Formula = "=FILTER('Live Data'!J:J,'Live Data'!M:M=" & Chr(34) & EventNo & Chr(34) & ")"

Fairly simple, and it works fine, but when I run the code the formula entered into the cell is:

=@FILTER('Live Data'!J:J,'Live Data'!M:M="EV9")

There is an @ at the start which prevents it from auto filling with the entire list. I have written the formula out to a variable after and it looks fine, so I have no idea where the @ is coming from. I have tried to use replace to get rid of it but it's not working.

Cheers.
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
You need to change the .Formula to .Formula2
 
Upvote 0
Solution
Thanks for the quick response. Worked like a charm. Not sure I would have figured that one out!
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,213,557
Messages
6,114,288
Members
448,563
Latest member
MushtaqAli

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