Percent Based Off Last Row Sum

G

Guest

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 :)
 
G

Guest

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top