View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Annette[_3_] Annette[_3_] is offline
external usenet poster
 
Posts: 32
Default Find percentage of sums

Now that I have this code, there is one last step which I don't know how to
write. If I record, it will be based on specific cells, which I never know
where the end will be. WIth that said, I used the following code provided
earlier that works great, but I need to now take the result of these two
numbers to figure a percent. Specifically =sum(b?-c?)/c?


Dim LastRow As Long
LastRow = Cells(Cells.Rows.Count, 1).End(xlUp).Row
Cells(LastRow + 1, 2).Formula = "=sum(b1:b" & LastRow & ")"

LastRow = Cells(Cells.Rows.Count, 1).End(xlUp).Row
Cells(LastRow + 1, 3).Formula = "=sum(c1:c" & LastRow & ")"


How can I write take the last number in columnl b minus last row in column
c divided by last row in column c? The result will be listed in the last
row of column D.

Thanks much!