+ Reply to Thread
Results 1 to 3 of 3

Subtracting values from last column in selection

  1. #1
    Registered User
    Join Date
    06-08-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2007
    Posts
    5

    Subtracting values from last column in selection

    I am a newbie in VBA and haven't found sample code that would help me do the following:

    1. Select a range of cells, for example A1:D10
    2. Subtract values in column A from D, values in column B from D, values in column C from D. So values in all columns need to be subtracted from the last column.
    3. Put the calculate values in the adjacent columns, E through to G.

    The number of columns and rows in the selection will vary.

    Thank you in advance for your help.

  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: Subtracting values from last column in selection

    Azul,

    Welcome to the forum!
    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
    06-08-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Subtracting values from last column in selection

    Thanks a lot! The code works perfectly.

+ 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