Hi,
I was wondering if anyone has a fast way of getting the data for the following problem. I have multiple sheets with multiple line items and for each sheet make some calculations (weighted averages, averages, max/min etc.). Each sheet has the same format (headers are the same). So it would be easy to go through a loop once and apply that to every sheet. For the first sheet it has to find a specific name in the header (there are 28 names in total) and once found, name the range using
Set MyRange1 = Range(Activecell,activecell.offset(NumberofLoans-1,0))
Instead of using MyRange1, Myrange2,....,MyRange28 I want to loop through this (For i = 1 to 28) and set these ranges corresponding to the i so something like: Set MyRange(i)= etc.
In the end I want to do the calculations using these set ranges so something like: Application.worksheetfunction.sumif(MyRange1,"Annuity",MyRange2)/application.worksheetfunction.sum(MyRange2)
Is there any way to this?
Thanks very much!
Egbert
I was wondering if anyone has a fast way of getting the data for the following problem. I have multiple sheets with multiple line items and for each sheet make some calculations (weighted averages, averages, max/min etc.). Each sheet has the same format (headers are the same). So it would be easy to go through a loop once and apply that to every sheet. For the first sheet it has to find a specific name in the header (there are 28 names in total) and once found, name the range using
Set MyRange1 = Range(Activecell,activecell.offset(NumberofLoans-1,0))
Instead of using MyRange1, Myrange2,....,MyRange28 I want to loop through this (For i = 1 to 28) and set these ranges corresponding to the i so something like: Set MyRange(i)= etc.
In the end I want to do the calculations using these set ranges so something like: Application.worksheetfunction.sumif(MyRange1,"Annuity",MyRange2)/application.worksheetfunction.sum(MyRange2)
Is there any way to this?
Thanks very much!
Egbert