Macro to populate formula based on value in cell M2

Hi Experts Using Excel 2013

need a macro to populate down the following array formula down column A starting at Cell A8.....

So if the value in cell M2 is 74 then populate down starting at A8 and incl A8 74 times if Cell m2 is 84 then so on..

=IFERROR(INDEX('Unique List'!$B$2:$B$2000,SMALL(IF('Unique List'!$A$2:$A$2000=$B$3,ROW('Unique List'!$A$2:$A$2000)-ROW('Unique List'!$A$2)+1),ROWS(B$8:B8))),"")
route217Asked:
Who is Participating?
 
xtermieConnect With a Mentor Commented:
Ok, use something like this:
'substitute for your column, formulas etc
Application.ScreenUpdating = False
lastRow = Range("A" & Rows.Count).End(xlUp).Row
Range("A8").Formula = "=$L$1/$L$2" 'substitute your formula '<-- you can skip this is you have the formula as an array formula in the spreadsheet
Range("A8").AutoFill Destination:=Range("A2:A" & lastRow)
0
 
xtermieCommented:
Why don't you just copy the formula down? Once you enter it as an array formula, in the initial cell, you can simply copy it down like any other formula
0
 
route217Author Commented:
Need the spread sheet to be dynamic...I have 650...company's...so everything I chang the select from the data validation list..I do not want to keep on coping the formula down..
0
 
route217Author Commented:
let me test...not sure i follow the instructions..
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.