G
Guest
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
' 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