Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default VBA code for Autosum command

I know I've used this before but I can't locate it. I'm
trying to find the VBA code for the Excel 'Autosum'
command. I'm using Excel 2003.
Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default VBA code for Autosum command

This is one way to make Autosum run by code:

Sub DoAutoSum()
Dim x As CommandBarControl
Set x = CommandBars.FindControl(ID:=226)
If Val(Application.Version) 9 Then _
Set x = x.Controls(1)
x.Execute 'AutoSum
If Selection.Cells.Count = 1 Then
x.Execute 'Again to exit edit mode
End If
End Sub

Here's another:

Sub DoAutoSumWithSendKeys()
SendKeys "%={Enter}"
End Sub


--
Jim Rech
Excel MVP
"Michelle" wrote in message
...
|I know I've used this before but I can't locate it. I'm
| trying to find the VBA code for the Excel 'Autosum'
| command. I'm using Excel 2003.
| Thanks!


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How 2 sort an autosum total list after adding items 2 autosum item akm Excel Discussion (Misc queries) 0 May 30th 10 11:44 PM
Command code Very Basic User Excel Discussion (Misc queries) 2 July 30th 09 05:58 PM
command code ( GOTO command) in formula calan New Users to Excel 1 June 11th 09 09:44 AM
Macro code to autosum a dynamic length column SlowPoke Excel Discussion (Misc queries) 3 March 31st 06 11:48 PM
Command Button VBA code Dave Peterson Excel Discussion (Misc queries) 2 January 25th 05 11:28 PM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"