recording formula help

jordanburch

Active Member
Joined
Jun 10, 2016
Messages
440
Office Version
  1. 2016
Hey guys so i recorded the follwing

=ROUND(SUMPRODUCT(($AR163:$AR3161=AR944)+0,SUBTOTAL(109,OFFSET($J163:$J3161,ROW($J163:$J3161)-MIN(ROW($J163:$J3161)),0,1,1))),2)

it came out as

dng.SpecialCells(xlCellTypeVisible).FormulaR1C1 = "=ROUND(SUMPRODUCT((R[-781]C44:R[2217]C44=RC[-1])+0,SUBTOTAL(109,OFFSET(R[-781]C10:R[2217]C10,ROW(R[-781]C10:R[2217]C10)-MIN(ROW(R[-781]C10:R[2217]C10)),0,1,1))),2)"

it works for the bottom mos visible cells but there are cell in between and thats why its failing. any sugesstions?

Jordan
 

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
How do you define failing? Are you getting an error message or is it simply not doing what you want it to?
its basically not inserting the formulas correctly. I believe its because some of the filtered cells are filtered and it stops at the first filter and then goes to the next filter. I need it to give me $J2:$J3500 not the J reference it is returning.
 
Upvote 0
If you set $J2:$J3500 without adjusting the rest of it proportionately then it will result in an error. There are a number of things about your formula that look wrong but without an example of what you're trying to do it is impossible to say for certain. See if this does what you need.

VBA Code:
dng.SpecialCells(xlCellTypeVisible).Formula = "=ROUND(SUMPRODUCT(($AR$2:$AR$3500=AR2)*SUBTOTAL(109,OFFSET($J$2,ROW($J$2:$J$3500)-ROW($J$2),0,1,1))),2)"
 
Upvote 0

Forum statistics

Threads
1,215,427
Messages
6,124,831
Members
449,190
Latest member
rscraig11

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