View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
patrick molloy patrick molloy is offline
external usenet poster
 
Posts: 391
Default Functions and Ranges

why not just use

..Range("C2").CopyFromRecordset Rs

Patrick Molloy
Microsoft Excel MVP

-----Original Message-----
The following code is an exerpt from an Access module

that drops records into Excel. Once in Excel I want to
run functions on the entire column of data like sum
(c1:c52), but come up with errors. Any thoughts? Thanks
in advance, Forrest

' to the Microsoft Excel spreadsheet.
Do Until Rs.EOF
For i = 0 To Rs.Fields.Count - 1
CurrentField = Rs(i)
Sheet.cells(j, i + 1).Value = CurrentField
Next i
Rs.MoveNext
j = j + 1
Loop

' Sum range of cells.
Sheet.cells(j, i).Value = Sheet.range("C50").Value + _
Sheet.range("c51").Value


.