Inserting a SUMIFS formula using excel macro

coop123

Board Regular
Joined
Dec 18, 2018
Messages
66
Office Version
  1. 365
Hello

I have a sumifs formula as part of a macro code.

ActiveCell.FormulaR1C1 = _
"=SUMIFS(M12:M" & ListEnd & ", $A12:$A" & ListEnd & ",""Non EU"",N12:N" & ListEnd & ",""<10"")" 'Non EU Less than 10%

Column M is the range to sum, column A is first criteria range and column N is second criteria. I am using ListEnd to give me last row in the columns. It is used throughout macro.


When running it stops with error Application-Defined or Object-Defined error.

Can someone point out where I have made the mistake.

Thanks in advance.

coop123
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
You need to use Formula, not FormulaR1C1
 
Upvote 0
Solution
Hi Fluff

Thank you for your solution.
It fixed my problem and macro now works.

Thanks Again

Coop123
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,215,225
Messages
6,123,732
Members
449,116
Latest member
Aaagu

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