Macro to Insert Changes the Formula

D

Dow

I searched for the answer but I could not find it on any previous
posts. I am sure it is an easy one and I am probably missing
something obvious -

I have a Macro that inserts a formula. It references another
worksheet in the same workbook.

Range("B1").Select
ActiveCell.FormulaR1C1 = "=COUNTIFS(Operations!
F:F,""AWP"",'Operations'!G:G,""<=20"")"

After the Macro is run this is the formula in cell B1:

=COUNTIFS('Operations'!F:(F),"AWP",'Operations'!G:(G),"<=20")

Why does it convert the range to F:(F)? And how can I fix it?

The worksheet name will change and its location could also possibly
change.

Thank you to anyone who helps. It is greatly appreciated.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top