+ Reply to Thread
Results 1 to 3 of 3

Incorporated Until empty cell with sum function

Hybrid View

chaz1010 Incorporated Until empty cell... 10-08-2013, 01:47 PM
sxn Re: Incorporated Until empty... 10-11-2013, 10:17 AM
chaz1010 Re: Incorporated Until empty... 02-16-2014, 06:11 AM
  1. #1
    Registered User
    Join Date
    10-08-2013
    Location
    Birmingham
    MS-Off Ver
    Excel 2007
    Posts
    3

    Post Incorporated Until empty cell with sum function

    Hi Team,

    Hope you are well. I have a spreadsheet with values in column as per below

    A1 = 100, A2 = 150, A3 = empty, A4 = 250, A5 = 125, A6 = empty, A7 = 220, A8 = 90, A9 = 100, A10 = empty, A11 = empty

    I need to created a loop funcion with a sum function incorporated in it. So that once it get executed, the empty values get populated as per below:

    A3 = A1 + A2 = 100 + 150 = 250

    A6 = A4 + A5 = 250 + 125 = 375

    A10 = A7 + A8 + A9 = 220 + 90 + 100 = 410

    But once there is two empty cells, i want the loop to exit. Please note the value between the empty cells in Column can vary, but no more than 10. Maybe I need to use a array to store the values and then output the sum of the array values.

    Im really confused and any help on this would be great

    Thanks Guys

    Chaz

  2. #2
    Registered User
    Join Date
    10-06-2013
    Location
    Brno
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Incorporated Until empty cell with sum function

    Sub AutoSum()
         For Each NumRange In Columns(ActiveCell.Column).SpecialCells(xlConstants, xlNumbers).Areas
            SumAddr = NumRange.Address(False, False)
            NumRange.Offset(NumRange.Count, 0).Resize(1, 1).Formula = "=SUM(" & SumAddr & ")"
            c = NumRange.Count
        Next NumRange
    End Sub

  3. #3
    Registered User
    Join Date
    10-08-2013
    Location
    Birmingham
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Incorporated Until empty cell with sum function

    Thanks for your help, It woked a treat!

+ 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] Using the Split function with another function incorporated is not working correctly
    By highlystrung in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-06-2013, 03:51 PM
  2. [SOLVED] How do you force a cell to appear empty when there is a function in it...
    By Legend Rubber in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-16-2012, 03:12 AM
  3. Multiple If Conditions-incorporated
    By eric1971 in forum Excel General
    Replies: 2
    Last Post: 06-12-2007, 11:33 AM
  4. Need Cell to stay empty if a function = 0
    By Lesbrewer in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-21-2006, 02:02 PM
  5. how to set a cell to EMPTY in a function?
    By serdar in forum Excel General
    Replies: 6
    Last Post: 07-24-2005, 08:05 PM

Tags for this Thread

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