sumif from another worksheet excel vba

curious K

New Member
Joined
Dec 28, 2015
Messages
22
I've worksheet "summary" & "ExpLedgers"

ExpLedgers having 8 columns

The 8th no. column i.e. column H having Ledgers GroupCode
I want sum of 6th column (Column F) to store in variable


DataArr(R1, 1) --> Group code store in this array e.g. here it is 16

for this I use following function but it gives an Run-time error '13' Type mismatch

WorksheetFunction.SumIf(Sheets("ExpLedgers").Range("$F:$F"), Sheets("ExpLedgers").Range("$H:$H"), DataArr(R1, 1))
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
Hi.

The syntaxes for SUMIF and SUMIFS are annoyingly inconsistent.

With SUMIF, it's:

=SUMIF(range, criteria, [sum_range])


Looks like you might have these in the wrong order.

Regards
 
Upvote 0
Yes after change accordingly it works!

WorksheetFunction.SumIf(Sheets("ExpLedgers").Range("$H:$H"), DataArr(R1, 1), Sheets("ExpLedgers").Range("$F:$F"))

Thanks.
 
Upvote 0

Forum statistics

Threads
1,216,126
Messages
6,129,005
Members
449,480
Latest member
yesitisasport

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