Write formula using vba

Matt111

Board Regular
Joined
Jul 20, 2004
Messages
83
Hi, I have a summary table which uses the formula below, however i'd like to change the way i go about this and solve this using vba, the problem is i can't get my head around converting it to run as part of a macro!!! could anyone help please? The formula below happens to be in D8 but it's relative so when i run the macro should go in all cells of the range D4:D60
cell contents:
=SUMPRODUCT((INDIRECT(InputSht&"$K$"&Report!$J$11&":$K$"&end_row&""))*(INDIRECT(InputSht&D$1&Report!$J$11&":"&D$1&end_row&"")*((INDIRECT(InputSht&"$"&LookupCol&"$"&Report!$J$11&":$"&LookupCol&"$"&end_row&"")=$B8))))

change to format suitable for macro e.g.
Range("D4:D60").Select
Selection.FormulaR1C1 = ".........

I guess this might not be very clear to you because i'm using name ranges but I'm running really short on time having struggled for a while with this!!!

...thanks in advance
Matt.
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes

Forum statistics

Threads
1,224,578
Messages
6,179,652
Members
452,934
Latest member
mm1t1

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