AutoSum button

  • Thread starter Thread starter pk
  • Start date Start date
P

pk

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.
 
PK,

Try the following:

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

Yes, you need to execute it twice.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com (e-mail address removed)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top