+ Reply to Thread
Results 1 to 5 of 5

Insert blank row and sum total above for each same field.

  1. #1
    Forum Contributor
    Join Date
    01-16-2014
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    440

    Insert blank row and sum total above for each same field.

    Hi,

    I have a report that I will need to insert a blank row after each unique group of value, then sum the above value. Is there a way to do it in VBA?
    The data is already sorted by same value in column P.
    From range P15, go to last same value, then insert 2 blank row, then on range S to U, sum the total above.
    Then continu.

    Here is the spreadsheet Sheet1(original), Result (result that should be).

    Split Sum Question.xlsx

    If anyone can help on this. Thank ou.

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,411

    Re: Insert blank row and sum total above for each same field.

    Data | Subtotals will do this for you - just record a macro while you go through it manually (Select the table, then Data/Subtotals, then For each change in P, sum S, T and U).

    Hope this helps.

    Pete

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

    Re: Insert blank row and sum total above for each same field.

    Maybe:

    Please Login or Register  to view this content.

  4. #4
    Forum Contributor
    Join Date
    01-16-2014
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    440

    Re: Insert blank row and sum total above for each same field.

    Pete: I need a vba macro because I have over 100 report to do it. By recording the macro, it will not go from the first to last row. and my data are different lenght for each report.

    John: This one work however it added 2 empty line under the header which I don't need that.
    Also, what is this code stand for in the code?

    Please Login or Register  to view this content.
    I see that variable but I don't see you use it anywhere in the code.

  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: Insert blank row and sum total above for each same field.

    Try:

    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] Macro to insert text in a field if another field is > 0.
    By Metrazal in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 08-13-2014, 11:05 AM
  2. Creating a macro to insert a blank row and total sums in a new column
    By volleyballtigger in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-23-2013, 10:42 AM
  3. [SOLVED] Macro to insert blank rows so that the total number of rows with data is equal to 1021
    By nsm1411 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-07-2013, 10:25 AM
  4. [SOLVED] Insert blank lines to make the total number of lines 67
    By raghuprabhu in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-29-2012, 07:34 AM
  5. Autoatically insert blank row above total when no more rows
    By Capsaisin in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-18-2006, 07:00 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