+ Reply to Thread
Results 1 to 2 of 2

Add row and sum macro

  1. #1
    Registered User
    Join Date
    08-16-2012
    Location
    US
    MS-Off Ver
    Excel 2010
    Posts
    16

    Add row and sum macro

    Attached is a worksheet(ABC1) which I would like to add a row between values in column f using this script:

    Sub OpenEncCalc2()
    '
    'Insert Row at change in Org ()

    Dim lRow2 As Long
    For lRow2 = Cells(Cells.Rows.Count, "F").End(xlUp).Row To 2 Step -1
    If Not IsEmpty(Cells(lRow2, "F")) And Not IsEmpty(Cells(lRow2 - 1, "F")) Then
    If Cells(lRow2, "F").Value <> Cells(lRow2 -1, "F") Then Rows(lRow2).EntireRow.Insert

    End If

    Next lRow2
    End Sub

    Now, I want to add a row between the Accounts too (row H) and Sum the "Cur Bal" Column L for all rows that have the either same Account Value (row H) or values less than 600000. I added a worksheet(ABC2) to the file that shows what I'd like the end result to be. It may make more sense than what I wrote.
    Attached Files Attached Files

  2. #2
    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: Add row and sum macro

    Hi saniamarco

    Please add Code Tags to the Code you posted.

    This Code is in the attached and appears to do as you require.
    Please Login or Register  to view this content.
    Attached Files Attached Files
    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.

+ 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] Macro to show Which macro didnt work in a nested macro
    By akhileshgs in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 06-10-2013, 03:21 AM
  2. Perform macro "on open" specific file- store macro in Personal Macro Workbook?
    By thompssc in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-17-2012, 12:38 PM
  3. lookup macro, solver macro, realtime macro
    By xelhelp in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-02-2011, 06:14 PM
  4. Cannot find macro error when running a macro from a macro in a diffrent workbook.
    By Acrobatic82 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-05-2010, 09:22 AM
  5. [SOLVED] Macro calling another Macro: "The macro 'Personal.xls!FindChar"
    By William Benson in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-07-2005, 09:05 AM

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