Thread: Summing a range
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Alan M Alan M is offline
external usenet poster
 
Posts: 69
Default Summing a range

Hi,

I need to use VBA code to define a range and then sum the values of the
cells in that range and place the answer in another cell. So far I have this
but it does not work!

I have defined ReportRange as the range to be summed and RangeValue as Long
to be used for the result

Set ReportRange = Sheets(2).Range(Cells(7, 24), Cells(EndDate, 24))

RangeValue = "=Sum(" & ReportRange.Address(True, False) & ")"


Sheets(16).Select


Sheets(16).Range("d12").Value = RangeValue


Where am I going wrong please?


Alan