Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Adding totals to columns where number of rows varies
I have a report that is exported into Excel from another application, and I
am attempting to write a macro to make some formatting changes. The number of rows of data changes depending upon the report parameters. Data appears in columns from A to H, and I want totals at the bottom of columns G and H only. The following code that I got off of this site does almost what I need, except that I end up with totals in more than just the two columns that I want. How do I limit the range so that I get totals only in G and H? Set rng = ActiveSheet.UsedRange Set rng = rng.Rows(rng.Rows.Count).Offset(2, 0).Cells rng.FormulaR1C1 = "=Sum(R[-1]C:R1C)" |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Adding totals from different columns | Excel Worksheet Functions | |||
Adding totals in columns | Excel Worksheet Functions | |||
Counting columns, adding totals #2 | Excel Programming | |||
Counting columns, adding totals #2 | Excel Programming | |||
Counting columns, adding totals | Excel Programming |