Paste into active cell, + Rows below

kcroft88

New Member
Joined
Jun 23, 2016
Messages
37
Hi,

Im looking for some support for a VBA macro to paste a formula into the active cell + a number of rows bellow.
I would like the following formula to paste in the active cell...

=IFERROR(INDEX(QueryReport!$A:$J,MATCH(1,(QueryReport!$A:$A=$B3)*(QueryReport!$C:$C=$A$3)*(QueryReport!$J:$J=G$2),0),4),0)

i would like this copied down the next 32 rows.
Then the same formula pasted into rows 40 - 63 (still in the column of the active cell.)
Then the same formula again pasted into rows 75 - 88 (still in the column of the active cell.)

Is it also possible once it has done this to then select all the cells we just pasted this formula into and copy and paste them into the same cell to remove the formula? leaving just the value the formula returned? I require this as this data will be populated on a daily basis and by copying and pasting to remove the formula reduces the constant calculations of formulas and wont slow the sheet down.

I hope that makes sense and someone is able to support

thank you,
 
Nor was I until I posted something similar & the OP complained.
 
Upvote 0

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
Morning Guys,

Thanks for your responses, the VBA is now placing the formula in the right cells. my next problem is i just realized i require the formula used in the VBA to be an array formula. when i simply just add {} to the VBA formula and run the code it seems to paste the code into the excel cell? does that make sense? how do i turn that VBA code formula into an array?

Thanks
 
Upvote 0
Change Formula to FormulaArray
 
Upvote 0

Forum statistics

Threads
1,215,461
Messages
6,124,952
Members
449,198
Latest member
MhammadishaqKhan

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