+ Reply to Thread
Results 1 to 5 of 5

Copy/Paste Categories with Totals

  1. #1
    Registered User
    Join Date
    11-30-2010
    Location
    wichita, ks
    MS-Off Ver
    Excel 2007
    Posts
    2

    Copy/Paste Categories with Totals

    Scenario:
    Main Ledger sheet that has 4 columns and copies the rows to the respective "category" sheets. The 4 columns will appear the same on each category sheet and will be sorted by date. I have gotten the code working for only one category, but when I try to add in another category, the code breaks on ActiveCell.Offset(1, 0).Select in the Vehicle-Truck category. I'm a novice in Excel, but do have a programming background. It seems to me that the offset is trying to go down a row, but the ActiveCell is already at the bottom of the sheet. I appreciate any help!! Thanks.

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by deltf97; 11-30-2010 at 03:26 PM. Reason: Solved!

  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: Copy/Paste Categories with Totals

    Hi deltf97

    Change this line of code from
    Please Login or Register  to view this content.
    to
    Please Login or Register  to view this content.
    and it should work.

    You may wish to consider what to do if there are no entries in a given Category.

    John
    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.

  3. #3
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Copy/Paste Categories with Totals

    The macro recorder code needs to not teach you bad habits, like "selecting" and "activating" to get data moved. Also, you can use the Data > Filter > Autofilter to mode this data pretty easily.
    Please Login or Register  to view this content.

    If you leave the two entries I put in E1:F1 on the Ledger sheet, you can take out that last section of code since the totals will already be there on each sheet.
    Attached Files Attached Files
    Last edited by JBeaucaire; 11-30-2010 at 01:38 PM.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  4. #4
    Registered User
    Join Date
    11-30-2010
    Location
    wichita, ks
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Copy/Paste Categories with Totals

    Thank you Jerry!!! Really appreciate it.
    This workbook is for my dad and this is the way he wanted it, so I'm trying to make it as simple as I can with as few as clicks as possible for him.

    Thanks again.

    Josh

  5. #5
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Copy/Paste Categories with Totals

    If that takes care of your need, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to 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