+ Reply to Thread
Results 1 to 5 of 5

[SOLVED] Replace Sum Formula with Values Being Summed

  1. #1
    Forum Contributor
    Join Date
    10-27-2005
    Posts
    177

    [SOLVED] Replace Sum Formula with Values Being Summed

    Hello everyone

    Say column A has values (some cells may be blank or 0) and cell B1 = sum(A:A).

    I would like a macro that will replace B1 with the values being summed, except 0s and blanks.

    So for example, col A has values A1=1 , A2=2, A3=(blank), A4=4 . B1 currently = sum(A:A). When the macro is run, B1 becomes =1+2+4

    I would really appreciate any help on this.
    Last edited by uberathlete; 06-21-2016 at 10:39 AM.

  2. #2
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Replace Sum Formula with Values Being Summed

    Hi, do you have any vba knowledge?
    This quick-and-dirty code will do that for you
    Please Login or Register  to view this content.
    ---
    Hans
    "IT" Always crosses your path!
    May the (vba) code be with you... if it isn't; start debugging!
    If you like my answer, Click the * below to say thank-you

  3. #3
    Valued Forum Contributor Kamboj's Avatar
    Join Date
    09-25-2014
    Location
    India
    MS-Off Ver
    2003 - 2010
    Posts
    430

    Re: Replace Sum Formula with Values Being Summed

    this code first sum all values and then replace b1 with sum value
    Please Login or Register  to view this content.
    Kamboj
    _________________________________________________________________________________
    Mark the thread as SOLVED if my answer satisfy you.

  4. #4
    Forum Contributor
    Join Date
    10-27-2005
    Posts
    177

    Re: Replace Sum Formula with Values Being Summed

    Hi Keebellah

    Yes I have some VBA knowledge. Looks like this code gives the final result of the sum formula. I was hoping for something that would change the formula to a sum of the actual values , ie. instead of =sum(A:A), it would become =1+2+4

  5. #5
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Replace Sum Formula with Values Being Summed

    Maybe:

    Please Login or Register  to view this content.

+ 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. [SOLVED] SUMIF where values to be summed are formula
    By Zakynthos in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 03:05 PM
  2. SUMIF where values to be summed are formula
    By Bob Phillips in forum Excel Formulas & Functions
    Replies: 18
    Last Post: 09-06-2005, 11:05 AM
  3. [SOLVED] SUMIF where values to be summed are formula
    By Bob Phillips in forum Excel Formulas & Functions
    Replies: 18
    Last Post: 09-06-2005, 07:05 AM
  4. SUMIF where values to be summed are formula
    By Bob Phillips in forum Excel Formulas & Functions
    Replies: 27
    Last Post: 09-06-2005, 04:05 AM
  5. [SOLVED] SUMIF where values to be summed are formula
    By Zakynthos in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 01:05 AM
  6. [SOLVED] SUMIF where values to be summed are formula
    By Zakynthos in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 AM
  7. [SOLVED] SUMIF where values to be summed are formula
    By Zakynthos in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 10:05 PM
  8. SUMIF where values to be summed are formula
    By Zakynthos in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 07-27-2005, 11:05 AM

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