ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   AutoSum button (https://www.excelbanter.com/excel-programming/281199-autosum-button.html)

pk

AutoSum button
 
Hello and help please!

In Excel XP, using VBA, is there a way to simulate a click
of the "AutoSum" button on the toolbar to insert a sum
formula into the current cell?

If so, can you supply example code to do it?

Thanks much in advance.


Chip Pearson

AutoSum button
 
PK,

Try the following:

Application.CommandBars.FindControl(ID:=226).Contr ols(1).Execute
Application.CommandBars.FindControl(ID:=226).Contr ols(1).Execute

Yes, you need to execute it twice.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"pk" wrote in message
...
Hello and help please!

In Excel XP, using VBA, is there a way to simulate a click
of the "AutoSum" button on the toolbar to insert a sum
formula into the current cell?

If so, can you supply example code to do it?

Thanks much in advance.





All times are GMT +1. The time now is 05:57 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com