Results 1 to 16 of 16

For every blank cell , sum those above it

Threaded View

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

    Re: For every blank cell , sum those above it

    I would do like this with VBA

    Sub Testing()
    Dim rng As Range
    Dim r1  As Long
    Dim r2  As Long
    r1 = 1    ' this must be the first row with value>0
    For Each rng In Range("C" & r1 & :C28")
        If rng.Value = 0 Then
            r2 = rng.Row - 1
            rng.Formula = "=SUM(R" & r1 & "C:R" & r2 & "C)"
            rng.Font.Bold = True
            r1 = rng.Offset(1, 0).Row
        End If
    Next rng
    End Sub
    The C28 you must change with a lastrow value + 1, the lastrow must always be a blank one.
    Attached Files Attached Files
    ---
    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

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Populate Text in Cell based on blank/non-blank status of other cell(s)
    By cmkarnes in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-24-2015, 06:53 AM
  2. Calculate differnce between 2 dates, but if 1 date cell is blank leave cell blank
    By Vicious00013 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-11-2014, 11:31 PM
  3. [SOLVED] Concatenate If Blank - remove blank line if first cell is blank
    By ker9 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 05-27-2014, 02:14 PM
  4. Replies: 3
    Last Post: 01-23-2014, 12:19 PM
  5. [SOLVED] Cell referenced in formula has no information displayed (shows blank), return blank cell
    By nunayobinezz in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-07-2013, 04:51 PM
  6. If cell blank OR another cell blank then show blank, if not display value
    By stevop622 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 04-09-2013, 04:07 AM
  7. [SOLVED] 1 or blank cell pulls exact text or leaves cell blank
    By sharpmel in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 11-30-2012, 12:20 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