Solved

Macro to populate formula based on value in cell M2

Posted on 2016-08-19
4
40 Views
Last Modified: 2016-08-19
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))),"")
0
Comment
Question by:route217
  • 2
  • 2
4 Comments
 
LVL 18

Expert Comment

by:xtermie
ID: 41762161
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
 

Author Comment

by:route217
ID: 41762167
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
 
LVL 18

Accepted Solution

by:
xtermie earned 500 total points
ID: 41762217
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
 

Author Comment

by:route217
ID: 41762221
let me test...not sure i follow the instructions..
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Approximate matching with VLOOKUP and MATCH seems to me to be a greatly under-used technique, and one which is vital for getting good performance out of large lookups. Until recently I would always have advised using an exact match for simplicity an…
This tutorial explains how to create a series of drop-down lists that are dependent upon prior selections to guide (“force”) the user to make the correct selection and reduce data errors within Microsoft Excel. Excel 2010 was used for this tutorial;…
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question