View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Ken Loomis Ken Loomis is offline
external usenet poster
 
Posts: 143
Default Inserting a SUM Function

Thanks, Duane. Yeah, that would have worked. I don't know why I got so
focused on doing a sum formula.

But I did figure that out.

The code looks like this:

mRow = mRow - 1

.Cells(mRow + 1, 1).Value = "Total"
.Cells(mRow + 1, 1).HorizontalAlignment = xlRight
.Cells(mRow + 1, 1).Font.Bold = True
.Cells(mRow + 1, 2).Formula = "=sum(B4:B" & mRow & ")"
.Cells(mRow + 1, 3).Formula = "=sum(C4:C" & mRow & ")"
.Cells(mRow + 1, 4).Formula = "=sum(D4:D" & mRow & ")"
.Cells(mRow + 1, 5).Formula = "=sum(E4:E" & mRow & ")"
.Cells(mRow + 1, 6).Formula = "=sum(F4:F" & mRow & ")"



Thanks for the post.

Ken Loomis


"duane" wrote in message
...

Would having vba calculate the sum and place it in the right cell work?
if so this would be easy - although I don't know exactly how to do it
off hand without fooling around a little.


--
duane


------------------------------------------------------------------------
duane's Profile:
http://www.excelforum.com/member.php...o&userid=11624
View this thread: http://www.excelforum.com/showthread...hreadid=268385