+ Reply to Thread
Results 1 to 6 of 6

Macro to insert line and sums

  1. #1
    Registered User
    Join Date
    11-09-2011
    Location
    Cali
    MS-Off Ver
    Excel 2010
    Posts
    9

    Macro to insert line and sums

    Im new to macros so need a little help
    Task: Need a macro to
    1)insert a line inbetween the change in name
    2)insert a (-sum) of the amounts for that person
    3)insert the person's name

    My Data:
    [Date ] [Name & Exp ] [amount]
    [1/1/11] [John Doe Fedex] [5.00]
    [1/5/11] [John Doe Stapes] [60.00]
    [1/6/11] [Adam Smith Rental] [250.00]
    [1/8/11] [Adam Smith Hotel] [299.00]

    Ideal Outcome:
    [Date ] [Name & Exp ] [amount]
    [1/1/11] [John Doe Fedex] [5.00]
    [1/5/11] [John Doe Stapes] [60.00]
    [John Doe] [-65.00]
    [1/6/11] [Adam Smith Rental] [250.00]
    [1/8/11] [Adam Smith Hotel] [299.00]
    [Adam Smith] [-549.00]

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,168

    Re: Macro to insert line and sums

    Hi room7,

    See the attached with a Pivot Table to see if it will do what you need. No formulas, No VBA or Macros
    Attached Files Attached Files
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Registered User
    Join Date
    11-09-2011
    Location
    Cali
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Macro to insert line and sums

    Quote Originally Posted by MarvinP View Post
    Hi room7,

    See the attached with a Pivot Table to see if it will do what you need. No formulas, No VBA or Macros
    This doesnt work, the 2nd colum is the name and explanation combined
    so : Jim Jones Office Max or Sally Turner Taco Bell

  4. #4
    Registered User
    Join Date
    11-09-2011
    Location
    Cali
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Macro to insert line and sums

    Please help. A macro would save me about 10 hours a week. I just cant get it to work right

    I have attached an example
    Sheet 1 is the raw data
    Sheet 2 is what i get after hours of work (The real list is 20k-30k lines)

    What I do:
    1) Go through and mannually instert line between each new name
    - move down list, shift+space, ctr+(+)
    2) Add sums move from bottom up
    - alt+h,u,s, enter
    -ctr+up, up
    -repeat over and over and over
    3) Find and replace 'Sum' with '-Sum'
    Attached Files Attached Files
    Last edited by room7; 11-15-2011 at 08:31 PM.

  5. #5
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,168

    Re: Macro to insert line and sums

    OK Room7,

    Find the attached where you can go through what I think you want using Grouping and some other Excel Tricks.

    1. You need to parse out the name to another column. I hope all names have spaces inbetween first and last.
    2. Group the data and use a subtotal
    3. Multiply all formulas in col D by neg 1.

    Not Easy Peasy but you should be able to do thousands of rows in a few steps.
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    11-09-2011
    Location
    Cali
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Macro to insert line and sums

    Quote Originally Posted by MarvinP View Post
    OK Room7,

    Find the attached where you can go through what I think you want using Grouping and some other Excel Tricks.

    1. You need to parse out the name to another column. I hope all names have spaces inbetween first and last.
    2. Group the data and use a subtotal
    3. Multiply all formulas in col D by neg 1.

    Not Easy Peasy but you should be able to do thousands of rows in a few steps.
    Works great...cuts my time down from 5hrs/week to 20mins
    Thank you so much

+ 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