Link to home
Start Free TrialLog in
Avatar of activematx
activematxFlag for United States of America

asked on

Excel Macro to copy a formula down cells

Hi Excel Experts,

Take a look at this screenshot:  User generated image
I've already entered the formula that I would like copied down the cells into the cells which are highlighted green.  I did this manually.  I would like the macro to do this for me all the way down the spreadsheet.

I've highlighted the next cells where the formula should go yellow, so you can get the idea.

Can someone help me with this macro?

I have attached the original workbook.  Thanks!

I have also attached my workbook with macros which experts helped me with earlier. That might be useful for you to see what they did.  Otherwise, it's not necessary to open the macro workbook if you are really good with macros.
Avatar of Saqib Husain
Saqib Husain
Flag of Pakistan image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of activematx


Hi ssaqibh!

Thanks, this macro does exactly what i want it to do.  The formula is pretty complex though, compared to my original.

Was there a reason this formula had to be used instead?

I am going to award you the points for this answer, but would you mind briefly explaining to me what the formula in the cells does:

This formula is essentially

The first sumproduct  sums the results of

The terms ($F$2=$F32) etc return 1 if the two terms are equal and 0 if not. In effect it is the sum of

whenever the corresponding F column value is equal to F32

Similarly the second sumproduct sums up