+ Reply to Thread
Results 1 to 1 of 1

sum in dynamic range

  1. #1
    Registered User
    Join Date
    09-05-2009
    Location
    RO
    MS-Off Ver
    Excel 2003
    Posts
    1

    sum in dynamic range

    HI,

    I am stucked with calculating sumes in dynamic range.
    Items in column A are copied from another sheet where are different ranges according with equip. categories (this ranges may vary). I want to make different sumes in column AB, according to different ranges as it is exemplified in the attached picture.
    Any help much appreciated.
    Best regards,
    Moshul

    later edit:
    With help from a smart girl friend I solved the problem:

    Sub test()
    Sheets(1).Activate
    LastRow = Range("AB" & Rows.Count).End(xlUp).Row
    j = 0
    For i = 5 To LastRow
    If Cells(i, 28).Value = "Total" Then
    Cells(i, 28).FormulaR1C1 = "=SUM(R[" & -j & "]C:R[-1]C)"
    j = 0 ' j is row diff in dinamic ranges (diff btw first row and last row of the corresponding dynamic range)
    Else
    j = j + 1
    End If
    Next i
    End Sub
    Attached Images Attached Images
    Attached Files Attached Files
    Last edited by moshul; 09-09-2009 at 02:47 PM. Reason: solved

+ 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