LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 852
Default Sum a variable length column

What little tidbit am I overlooking here.
rangeC selects the correct range.
rSum is the correct cell (First empty cell below the last entry in col C)

Returns #NAME error
Also tried this but does not compile rSum.Formula = "=Sum("C2:C" & lr)"

Thanks,
Howard

Option Explicit

Sub summerup()
Dim rangeC As Range
Dim rSum As Range
Dim lr As Long

lr = Cells(Rows.Count, 3).End(xlUp).Row
Set rangeC = Range("C2:C" & lr)

Set rSum = Range("C" & lr + 1)
'rangeC.Select
rSum.Formula = "=Sum(rangeC)"
End Sub
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Summing a Column of Variable Length Carlee Excel Programming 3 April 6th 07 09:42 PM
Autosum a variable column length using VB sid[_3_] Excel Programming 4 May 17th 06 04:00 PM
Sum a Column of Variable length Chris G Excel Discussion (Misc queries) 4 November 7th 05 12:25 PM
Sum a column of variable length? Brian Excel Discussion (Misc queries) 5 February 3rd 05 02:26 PM
Averaging a variable length column Doug[_10_] Excel Programming 1 June 22nd 04 07:48 PM


All times are GMT +1. The time now is 10:17 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"