View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default VBA-Add Column Totals

set rng = ActiveSheet.UsedRange
set rng = rng.rows(rng.rows.count).offset(1,0).Cells
rng.FormulaR1C1 = "=Sum(R[-1]C:R1C)"
ActiveSheet.Printout
rng.EntireRow.Delete

--
Regards,
Tom Ogilvy

"Chris Linger" wrote in message
...
I have a series of reports I would like to know VBA code
to add totals to the columns as part of code that displays
a range in print preview mode. But then needs to
be "cleared" when closing, so that additional records
(rows of data) can be added via data form. Can anyone
assist? Thanks, Chris