ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Help with Formula in Code (https://www.excelbanter.com/excel-programming/357151-re-help-formula-code.html)

JMB

Help with Formula in Code
 
Cells(i, "o").Value = application.sum(range(Cells(i, "I"), Cells(i, "N")))



"Juan" wrote:

Hi,
have following Code that I would like to modify. So instead of dividing, I
want to Sum but can't seem to get the right logic.
' Dim i as long

For i = 1 To ActiveSheet.UsedRange.Rows.Count
If Cells(i, "A") = "" Then
Cells(i, "o").Value = Cells(i, "I") / Cells(i, "N")
End If
Next
Basically, I want to sum of columns I throuh N where Column A is Blank in
Column O.

Please advise any info would really appreciate it.

Thanks,
Juan



All times are GMT +1. The time now is 01:28 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com