+ Reply to Thread
Results 1 to 4 of 4

Cell Selection Macro

  1. #1
    Registered User
    Join Date
    05-29-2012
    Location
    Wichita
    MS-Off Ver
    Excel 2007
    Posts
    3

    Cell Selection Macro

    Hi all,
    I have decided to post here to see if there is a solution to my Macro problem. I am faily new to Excel. I am supposed to be an Airframe and Powerplant Mecahnic but due to a job loss I have found myself using Excel at my new employment. I use a lot of macros that I record and edit to speed things up. One such puts column sum in the cell I select.
    Here is the Macro:

    Sub Sum()
    '
    ' Sum Macro
    '

    '

    ActiveCell.Formula = "=SUM(V3:R[-2]C)"

    End Sub


    Here's how it works:
    I select the cell I want the sum in. Run the macro. It selects the cell 2 rows above my selected cell (R[-2]C) and enteres that in the formula. It creates the formula for me, =SUM('V3':V122) (the second number varies depending on the cell iselect). The problem is that since I put V3 in the macro as the first cell in the formula it adds the ' around it and I have to manually remove it.
    Thanks, Joe

  2. #2
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Cell Selection Macro

    Joe,

    Welcome to the forum! In the future, please wrap your code in code tags (see link in my sig for how).
    As to your question, something like this should work for you:
    Please Login or Register  to view this content.
    Hope that helps,
    ~tigeravatar

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Registered User
    Join Date
    05-29-2012
    Location
    Wichita
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Cell Selection Macro

    Wow, thanks that did the trick nicely. Any good resources on leaning the VBA code language? Right now my only resource is Google. It works sometimes. But as that saying about fishing goes.

  4. #4
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Cell Selection Macro

    rascalydoo,

    There are many links to resources for learning VBA in this thread:
    http://www.excelforum.com/excel-prog...materials.html

+ Reply to Thread

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