Implicit Intersection Operator: @

dhancy

Board Regular
Joined
Jul 10, 2013
Messages
120
Office Version
  1. 2016
Platform
  1. Windows
Hello,

Our agency recently upgraded to Excel for Microsoft 365 MSO (version 2302).

In one of my VBA scripts, I have this formula:


VBA Code:
Cells(s, 6) = "=sum(1/countif(F8:F" & s - 1 & ", F8:F" & s - 1 & "))"


When I run my script, I see this in Cell(s,6)

Code:
=SUM(1/COUNTIF(F8:F26,@ F8:F26))

But this gives me a result of #DIV/0

When I remove the @ symbol, I get the correct answer.

How can I prevent @ from showing up?


Thank you!


Dennis
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
Sounds like you need to use Formula2 rather than Formula
 
Upvote 0
Solution
Thanks, but in my code, I do not use @.

I am not sure how it got into my spreadsheet. It seems to show up on my spreadsheet automatically.
 
Upvote 0
What Fluff is saying is to use Cells(s, 6).Formula2 = not just Cells(s, 6) =
 
Upvote 0
Oh! For as long as I've been writing VBA scripts, I did not know there was a "Formula2" option. This works!!

Thank you Fluff and RoryA!!!


Dennis
 
Upvote 0
For as long as I've been writing VBA scripts, I did not know there was a "Formula2" option.
There hasn't, it only came out with 365 & 2021 to cater for spill ranges.
 
Upvote 0

Forum statistics

Threads
1,215,147
Messages
6,123,297
Members
449,095
Latest member
Chestertim

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