![]() |
Percent Based Off Last Row Sum
This is what I have:
Columns("H:H").Select LastRow = Cells(Rows.Count, "H").End(xlUp).Row Cells(LastRow + 2, "H") = Application.Sum _ (Range(Cells(1, "H"), Cells(LastRow, "H"))) This sums the entire row in am empty cell two spaces below the last cell with a value in it. Dim LastRow As Long With ActiveSheet LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row .Range("e2:E" & LastRow).Formula = "=$d2/$d$49" This formula is what I have. This figures the percent by dividing d2 into D49, which happens to be the sum column in my current data, then auto fills it into all subsequent cells of that column to the bottom of the cells with values. I want to take that resulting Sum of the first formula value and incorporate it into a formula to calculate percentage that is not specific to tose cells. BECAUSE, when I import new data from other places it may have more or less rows. SO how can I figure the percentage using the resulting value of the first formula???? THANKS!!! If you need clarification, please ask :) |
Percent Based Off Last Row Sum
l1 = .Cells(.Rows.Count, "d").End(xlUp).Row
LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row .Range("e2:E" & LastRow).Formula = "=$d2/$d$" & l1 perhaps. -- Regards, Tom Ogilvy "bodhisatvaofboogie" wrote: This is what I have: Columns("H:H").Select LastRow = Cells(Rows.Count, "H").End(xlUp).Row Cells(LastRow + 2, "H") = Application.Sum _ (Range(Cells(1, "H"), Cells(LastRow, "H"))) This sums the entire row in am empty cell two spaces below the last cell with a value in it. Dim LastRow As Long With ActiveSheet LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row .Range("e2:E" & LastRow).Formula = "=$d2/$d$49" This formula is what I have. This figures the percent by dividing d2 into D49, which happens to be the sum column in my current data, then auto fills it into all subsequent cells of that column to the bottom of the cells with values. I want to take that resulting Sum of the first formula value and incorporate it into a formula to calculate percentage that is not specific to tose cells. BECAUSE, when I import new data from other places it may have more or less rows. SO how can I figure the percentage using the resulting value of the first formula???? THANKS!!! If you need clarification, please ask :) |
All times are GMT +1. The time now is 04:04 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com