Sum of cells of a row using macro

macro_user

Board Regular
Joined
Mar 9, 2009
Messages
101
hi...
i need to implement this formula in a macro for all the rows in the worksheet.
E11=INT(SUM(DJ9:ER9)/(3*20*15)*100)
this formula is to find the sum of all numbers from DJ9 to ER9 and then multiply and divide by integers...
how do i put this formula in a loop so that it finds the sum of all numbers tilll row number 50?
Appreciate ur help...
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
No... i have 500 rows... so, i cant do tat... and i have few reports generated previously and i will be using this data calculated from the formula to create another report... is there some way where i can loop it?
E9=INT(SUM(DJ9:ER9)/(3*20*15)*100)
E10=INT(SUM(DJ10:ER10)/(3*20*15)*100)
and so on...
is there any way i can loop it?
 
Upvote 0
Just copy it through your 500 rows, it will take less time than you have spent asking your question.
 
Upvote 0
My requirement is to write a macro :) and i need this to happen at the click of a button... if its just for my purpose, then its not an issue... but... :)
 
Upvote 0
It would be just as quick to fill the formula down. However

Code:
Sub test()
Range("E11:E50").Formula = "=INT(SUM(DJ9:ER9)/(3*20*15)*100)"
End Sub
 
Upvote 0
It would be just as quick to fill the formula down. However

Code:
Sub test()
Range("E11:E50").Formula = "=INT(SUM(DJ9:ER9)/(3*20*15)*100)"
End Sub

sorry for wat im asking but this would work even for rows from DJ10 to ER10, DJ11 to ER11 and all other rows...?
 
Upvote 0
My requirement is to write a macro and i need this to happen at the click of a button... if its just for my purpose, then its not an issue... but...
Just be sure to tell your instructor that if he has any questions on your code, to contact Peter, keeping in mind that Peter is in the UK, so he'd need to inquire early in the day.
 
Upvote 0

Forum statistics

Threads
1,202,984
Messages
6,052,913
Members
444,612
Latest member
FajnaAli

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