Excel VBA Course
Excel VBA Course - From Beginner to Expert

200+ Video Lessons
50+ Hours of Video
200+ Excel Guides

Become a master of VBA and Macros in Excel and learn how to automate all of your tasks in Excel with this online course. (No VBA experience required.)

View Course

Unexpected @ symbol added to my formula

0

I used this simple formula to filter data, and it is working perfectly.

=FILTER(Data!A:H,ISNUMBER(SEARCH("Outstanding",Data!G:G)))

I have several buttons – Customer / Date / Outstanding etc. I would like it so that when the user clicks on the appropriate button it shows the filtered data.  I used the above formula in the code shown below.

Range("B18").Value = "=FILTER(Data!A:H,ISNUMBER(SEARCH(""Outstanding"",Data!G:G)))"

The problem I am having is that when the button is pushed the formula is returning with the @ symbol at the front which means I don't get the full results showing up, just the first cell.  As soon as I delete the @ from the formula bar it works properly.

=@FILTER(Data!A:H,ISNUMBER(SEARCH("Outstanding",Data!G:G)))

I have obviously done something wrong or am missing something in my code and I would very much appreciate some help in fixing this issue.

Answer
Discuss

Answers

0
Selected Answer

Hi again Dottj

You didn't attach a file for me to test but instead of writing the .Value property, try writing the .Formula2 property instead, as follows:

Range("B18").Formula2 = "=FILTER(Data!A:H,ISNUMBER(SEARCH(""Outstanding"",Data!G:G)))"

Note for other users: the worksheet function FILTER is only available in Dynamic Arrays enabled versions of Excel (i.e. 2021, 2024 and 365), where Formula2 replaces the Formula property.

Hope this fixes things for you. If so, please remember to mark this Answer as Selected

Discuss

Discussion

That worked perfectly, thank you so much.
Dottj (rep: 6) Feb 13, '25 at 7:42 pm
Add to Discussion


Answer the Question

You must create an account to use the forum. Create an Account or Login