Sum command in VBA

S

sally

I have a xcel spreadsheet that reads data from an Access
database. Since the database determines how many rows
are in the database - I need to programatically create
the totals at the bottom of a column....

something like:
ws.[c19].Offset(iro, i) = SUM(ws.[c19].Offset(0, i):ws.
[c19].Offset(irow,i))

but of course that gives an error .... I know this can't
be that difficult!

Thanks,
Sally
 
T

Tom Ogilvy

ws.[c19].Offset(iro, i).Formula = "=SUM(" & _
ws.Range(ws.[c19].Offset(0, i),ws.[c19].Offset(irow,i).Address
& ")"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top