+ Reply to Thread
Results 1 to 7 of 7

Macro to SUM and COUNT rows that have been seperated by an Item.

  1. #1
    Registered User
    Join Date
    06-10-2004
    Posts
    22

    Macro to SUM and COUNT rows that have been seperated by an Item.

    All I have a worksheet that I have to separate the data by date. I have that much figured out how to insert two lines after each change in date.

    What I'm needing is at the column to the right of the Amount a summation of the days $$$$ and in the next column a count of transactions. I'm an extreme newby to VBA. Thanks you for your help!

    I've attached a worksheet giving the layout.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    4,729

    Re: Macro to SUM and COUNT rows that have been seperated by an Item.

    Is the original data with empty rows prepared or do we need to do it?
    - Battle without fear gives no glory - Just try

  3. #3
    Forum Guru
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,445

    Re: Macro to SUM and COUNT rows that have been seperated by an Item.

    First post after 10 years. This could be a record.
    All in one, including inserting rows. The code works on the active sheet.
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    4,729

    Re: Macro to SUM and COUNT rows that have been seperated by an Item.

    See attached a possibility
    Attached Files Attached Files
    Last edited by PCI; 10-22-2014 at 05:06 PM.

  5. #5
    Registered User
    Join Date
    06-10-2004
    Posts
    22

    Re: Macro to SUM and COUNT rows that have been seperated by an Item.

    Okay, I'm having an ID10T moment. The macro works great for dates in column "A". For a date field in column "I", would the code change from:

    For i = .Cells(.Rows.Count, 1).End(xlUp).Row + 1 To 3 Step -1

    to

    For i = .Cells(.Rows.Count, 9).End(xlUp).Row + 1 To 3 Step -1

  6. #6
    Forum Guru
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,445

    Re: Macro to SUM and COUNT rows that have been seperated by an Item.

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    06-10-2004
    Posts
    22

    Re: Macro to SUM and COUNT rows that have been seperated by an Item.

    AB33,

    Thanks so very much.

    Brian

+ 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. Rank sub groups of rows seperated with blank rows
    By peasther in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-28-2014, 05:52 PM
  2. [SOLVED] Formula to count the occurance of values seperated by a comma
    By bouncingbudha in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-02-2013, 10:23 PM
  3. Split comma seperated column in to new rows
    By singy33 in forum Excel General
    Replies: 1
    Last Post: 08-06-2009, 12:35 PM
  4. count the number of members in cells seperated by ;
    By wali in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-23-2008, 01:46 PM
  5. How to protect data in rows from being seperated during sort
    By tired of finding my data scrambled in forum Excel General
    Replies: 2
    Last Post: 07-31-2005, 05:05 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