Home |
Search |
Today's Posts |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub AutoSumForLazyUsers()
Range("A" & Rows.Count).End(xlUp).Offset(1).FormulaR1C1 = _ "=Sum(R1C:R[-1]C)" 'Change "A" to Your Column and 'R1C' to your first row End Sub -- Charles Chickering "A good example is twice the value of good advice." "childofthe1980s" wrote: Hello: Is it possible to create a macro in Excel that will sum up a column of data, rather than having the end user press the AutoSum button? I know it sounds "lazy" on the user's part, but there is a good reason. The situation is that an external application is going to be exporting data to Excel, and the application can use Excel macros perfectly. I want to create a macro in Excel that will automatically sum up a column of data immediately after the data is exported to Excel. Now, the number of records in that column is not going to be the same everytime. I mean, the number of records one time might be 30, the next time it might be 40, etc.? Is this all possible to do in a macro? Thanks! childofthe1980s |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Sub Macro vrs Function Macro Auto Start | Excel Discussion (Misc queries) | |||
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort | Excel Worksheet Functions | |||
Auto-run macro after auto-query refresh (Excel2000,sr1) | Excel Programming | |||
Auto macro | Excel Programming | |||
auto run a macro | Excel Programming |