Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Automating the summing of columns
I have a spreadsheet which I send out each month. The
spreadsheet varies in length from one month to another. Before I send it out, I sum the data in Columns A, C & E and place the totals at the bottom of the corresponding columns. Is it possible to get a macro to do this bearing in mind that there is likely to be a differing number of rows each week. If so, is it possible to bold and underline the totals also ? Many thanks |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Automating the summing of columns
Steve,
Try some code like the following. Repeat for columns C and E. Dim Rng As Range Set Rng = Range("A1").End(xlDown)(2, 1) Rng.Formula = "=SUM(A1:" & Rng(0, 1).Address(False, False) & ")" Rng.Font.Bold = True Rng.Font.Underline = True -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Steve" wrote in message ... I have a spreadsheet which I send out each month. The spreadsheet varies in length from one month to another. Before I send it out, I sum the data in Columns A, C & E and place the totals at the bottom of the corresponding columns. Is it possible to get a macro to do this bearing in mind that there is likely to be a differing number of rows each week. If so, is it possible to bold and underline the totals also ? Many thanks |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Automating the summing of columns
Thank you Chip
-----Original Message----- Steve, Try some code like the following. Repeat for columns C and E. Dim Rng As Range Set Rng = Range("A1").End(xlDown)(2, 1) Rng.Formula = "=SUM(A1:" & Rng(0, 1).Address(False, False) & ")" Rng.Font.Bold = True Rng.Font.Underline = True -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Steve" wrote in message ... I have a spreadsheet which I send out each month. The spreadsheet varies in length from one month to another. Before I send it out, I sum the data in Columns A, C & E and place the totals at the bottom of the corresponding columns. Is it possible to get a macro to do this bearing in mind that there is likely to be a differing number of rows each week. If so, is it possible to bold and underline the totals also ? Many thanks . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Summing across columns while skipping some columns | Excel Worksheet Functions | |||
Copying columns and automating data updates across worksheets | Excel Discussion (Misc queries) | |||
Automating a series of dates for two columns? | Excel Worksheet Functions | |||
summing columns | Excel Worksheet Functions | |||
Summing columns | Excel Programming |