+ Reply to Thread
Results 1 to 8 of 8

Macro to create sub total as also inserting blank rows after each subtotal

  1. #1
    Registered User
    Join Date
    06-09-2013
    Location
    Kolkata,India
    MS-Off Ver
    Excel 2010
    Posts
    7

    Post Macro to create sub total as also inserting blank rows after each subtotal

    Hi All,

    I want create a macro that will subtotal of column E after change of value in column D. It will also insert two blank rows below the sub total rows.

    exampls of spreadsheet that need to be calculate as follows:

    please assume header name in row 1.

    Security name address date ID Div Amount
    aa ww 3/4/2009 ss 234
    aa ww 4/5/2009 ss 235
    bb er 5/6/2009 tt 456
    bb er 7/6/2010 tt 777

    thanks in advance

  2. #2
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Macro to create sub total as also inserting blank rows after each subtotal

    Rijlabels Som van Div Amount
    ss 469
    tt 1.233
    Eindtotaal 1.702

    With pivot table.
    See the attached file.
    Attached Files Attached Files
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  3. #3
    Registered User
    Join Date
    06-09-2013
    Location
    Kolkata,India
    MS-Off Ver
    Excel 2010
    Posts
    7

    Post Re: Macro to create sub total as also inserting blank rows after each subtotal

    Sorry Friend,

    I want a macro. After formatting data I need some more work to do which are basically some Formula based work. I don't think Pivot table can solve that.

    Thanks

  4. #4
    Valued Forum Contributor
    Join Date
    03-21-2013
    Location
    cyberia
    MS-Off Ver
    Excel 2007
    Posts
    457

    Re: Macro to create sub total as also inserting blank rows after each subtotal

    maybe like this
    Please Login or Register  to view this content.

  5. #5
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Macro to create sub total as also inserting blank rows after each subtotal

    @Kalak

    I get an faillure, if i test it on my data in #2.

    The faillure line is:

    Please Login or Register  to view this content.

  6. #6
    Valued Forum Contributor
    Join Date
    03-21-2013
    Location
    cyberia
    MS-Off Ver
    Excel 2007
    Posts
    457

    Re: Macro to create sub total as also inserting blank rows after each subtotal

    Quote Originally Posted by oeldere View Post
    @Kalak

    I get an faillure, if i test it on my data in #2.

    The faillure line is:

    Please Login or Register  to view this content.
    It was tested on data in post#1, as requested, and worked without error.

    After your post I downloaded your file and tried that. Got obvious error message (in Blad1) that can't move part of a pivot table. I didn't use pivot tables because they weren't requested. But inserting rows was requested.

    So copied and pasted special (values) your blad1 data to your blad2. The code worked on the blad2 data without error.

    Perhaps you should recheck your workings and/or try the code on the original posted data rather than first distorting it though a pivot table.

  7. #7
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Macro to create sub total as also inserting blank rows after each subtotal

    @kalak

    Thanks for taking the time to respond.

    After deleting the pivot table. the code works fine.

    I thank you for pointing me in the right direction.

    Also thanks for the quick reply.

  8. #8
    Registered User
    Join Date
    06-09-2013
    Location
    Kolkata,India
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Macro to create sub total as also inserting blank rows after each subtotal

    Thanks Friends,

    It works fine.

    Thanks again.

+ 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