+ Reply to Thread
Results 1 to 7 of 7

Help with subtracting numbers in columns

  1. #1
    Registered User
    Join Date
    10-08-2013
    Location
    Eugene, OR
    MS-Off Ver
    Excel 2010
    Posts
    43

    Help with subtracting numbers in columns

    I have a spreadsheet where I have entered the formula =SUM(I1)-L1 in Column J (this formula is then copied down Column J to match the number of rows in Column I & L).

    What I want to do is create VBA code that will automatically subtract Column L from Column I with the result in J, but I'm unsure how to do this when the number of rows is different from spreadsheet to spreadsheet. I then need a subtotal of Column J to show at the end of the column.

    I've attached a spreadsheet showing what it looks like after the calculation.

    Any help would be much appreciated!
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Help with subtracting numbers in columns

    What do you expect from VBA in which you would not get from a formula?
    In other words, what a formula can not do while VBA can do.
    It is not clear from your sample.

  3. #3
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Help with subtracting numbers in columns

    Hi Ellen

    What's the Data look like BEFORE???
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  4. #4
    Registered User
    Join Date
    10-08-2013
    Location
    Eugene, OR
    MS-Off Ver
    Excel 2010
    Posts
    43

    Re: Help with subtracting numbers in columns

    See attached for spreadsheet before the calculation..
    Attached Files Attached Files

  5. #5
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Help with subtracting numbers in columns

    Hi Ellen

    This Code is in the attached and appears to do as you require...to execute the Code...Ctrl + x
    Please Login or Register  to view this content.
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    10-08-2013
    Location
    Eugene, OR
    MS-Off Ver
    Excel 2010
    Posts
    43

    Re: Help with subtracting numbers in columns

    Thanks so much. That worked perfectly. I appreciate you taking the time to help me out.
    Have a great day!

  7. #7
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Help with subtracting numbers in columns

    You're welcome...glad I could help. Thanks for the Rep.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 9
    Last Post: 09-18-2012, 09:16 PM
  2. [SOLVED] Subtracting Numbers In This Format 1-0
    By mightyeskimo in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-18-2012, 07:14 AM
  3. subtracting two numbers
    By jippee in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 03-22-2010, 09:37 AM
  4. subtracting numbers
    By nevs66 in forum Excel General
    Replies: 7
    Last Post: 10-11-2007, 12:10 PM
  5. [SOLVED] Subtracting numbers
    By Annette in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-05-2005, 11:06 PM

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