Results 1 to 2 of 2

Excel 2007 : AutoSum and Combining Macro

Threaded View

  1. #1
    Forum Contributor
    Join Date
    01-28-2010
    Location
    Riverside, CA
    MS-Off Ver
    Excel 2010
    Posts
    132

    AutoSum and Combining Macro

    Hello All,

    I'm new to the forum, and I did try to search for a solution before posting. Currently I have be able to create 2 working macros regarding AutoSum, where it 1) automatically selects a range and autosums, then 2) cuts/pastes to desired location.

    I would like to combine the two, but the macro always seems to get stuck on the AutoSum code.

    I've tried combining the two codes into one (all code in sandwiched between ''sub' and 'end sub').
    I've tried:
    Sub macrocomb ()
      call macro1
      call marco2
    end Sub
    I've even tried putting in a wait timer to put a delay in between the two macros.

    Here are my two working separate macros:
    Sub AutoSum1()
    '
    ' AutoSum1 Macro
    '
    ' Keyboard Shortcut: Ctrl+k
    '
        ActiveCell.Offset(0, 1).Range("A1").Select
        Selection.End(xlUp).Select
        ActiveCell.Offset(1, -1).Range("A1").Select
        Range(Selection, Selection.End(xlDown)).Select
        Application.SendKeys ("%=~")
    End Sub
    Sub AutoSum2()
    '
    ' AutoSum2 Macro
    '
    ' Keyboard Shortcut: Ctrl+j
    '
        Selection.End(xlDown).Select
        Selection.Cut
        ActiveCell.Offset(-1, 1).Range("A1").Select
        ActiveSheet.Paste
        ActiveCell.Offset(1, -1).Range("A1").Select
    End Sub
    Any help would be appreciated. Thanks in advanced

    *added Code Tags, sorry about that
    Last edited by haru; 01-28-2010 at 06:47 PM. Reason: added code tags

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1