Excel: How to Use AutoSum in a MacroID: Q103164
|
In Microsoft Excel, there is no macro function to emulate the behavior of the AutoSum tool. However, you can activate this tool from a macro by using the SEND.KEYS() function to send the appropriate keyboard shortcut (ALT+EQUAL SIGN (=)) to start the AutoSum tool.
Sub AutoSum()
'This macro activates the AutoSum function on the active cell.
Application.SendKeys ("%=~")
End Sub
A1: =SEND.KEYS("%=")
A2: =SEND.KEYS("~")
A3: =RETURN()
Explanation of Above Macro
A1: Sends the AutoSum Keyboard Shortcut
A2: Sends the Enter Key
A3: Ends the macro
Microsoft provides macro examples for illustration only, without
warranty either expressed or implied, including but not limited to the
implied warranties of merchantability and/or fitness for a particular
purpose.
"User's Guide 1," version 4.0, pages 152, 556
"Function Reference," version 4.0, page 385
Additional query words: 4.00a sum end row column formula
Keywords :
Version : 4.00 4.00a 5.00 5.00c 7.00
Platform : WINDOWS
Issue type :
Last Reviewed: July 23, 1999