2 methods to automatically use the Autosum function key from VBA.
Note: Method uses commandbar Id's, as far as I know these id's are the same for versions 97+, or at least one would think so, bearing in mind that for compatibilty reasons microsift would/should NOT change these.
If you find this not to be the case then please let me know.
Option Explicit
Sub AutoSum1()
CommandBars.FindControl(ID:=226).Execute
Application.SendKeys "~"
End Sub
Sub AutoSum2()
With Application.CommandBars.FindControl(ID:=226)
.Execute
.Execute
End With
End Sub
The image above shows you what this code simulates ie. the pressing of the Autosum button, with a cell active.