+ Reply to Thread
Results 1 to 7 of 7

Inserting a space and Suming Macro

  1. #1
    Registered User
    Join Date
    06-17-2011
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2003
    Posts
    8

    Inserting a space and Suming Macro

    Hello everyone,

    I have searched around on the forum and on google for the macro but have not found anything that could be modified ( at least by me, as I dont know VB) to fit my task.

    I have attached a file which shows my data at the top, and then the result that I need at the bottom.
    It is basically inserting a space in between ticket numbers and then summing up the amount of units under that ticket.

    Any assistance will greatly be appreciated.
    - Thank you for the help,
    Denis
    Attached Files Attached Files
    Last edited by lobodade; 06-20-2011 at 03:06 PM.

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

    Re: Inserting a space and Suming Macro

    A programming-less solution, if you don't mind... Just put this formula in F2 and copy down:

    =IF(OR(A3<>"",B3=""), "Total: " & SUM(INDEX($E$1:$E2, MATCH(99^99, $A$1:$A2, 1)):E2), "")
    _________________
    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!)

  3. #3
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Inserting a space and Suming Macro

    check attachment, run code "test"
    Attached Files Attached Files
    Last edited by watersev; 06-20-2011 at 04:57 PM.

  4. #4
    Registered User
    Join Date
    06-17-2011
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: Inserting a space and Suming Macro

    JBeaucaire,

    Thank you for that code. it works well but i still need that space in between ticket numbers.
    - Denis

    Quote Originally Posted by JBeaucaire View Post
    A programming-less solution, if you don't mind... Just put this formula in F2 and copy down:

    =IF(OR(A3<>"",B3=""), "Total: " & SUM(INDEX($E$1:$E2, MATCH(99^99, $A$1:$A2, 1)):E2), "")

  5. #5
    Registered User
    Join Date
    06-17-2011
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: Inserting a space and Suming Macro

    Hi watersev,

    When i ran the macro the first toal came out to be 15, when in reality it should be 47. The macro looks very confusing to me so I cant really play around with it. Could you please double check that total?
    Also Instead of the ticket number and Count, is it possible for it to just say Total?

    - Thank you,
    Denis

    Quote Originally Posted by watersev View Post
    check attachment, run code "test"

  6. #6
    Registered User
    Join Date
    06-17-2011
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: Inserting a space and Suming Macro

    Hello again guys.

    So i found a way to make it work and all I need is a macro that will insert rows. I found many different ones on this site but cant get any of them to work.
    I just need a way to add a space before every ticket number

    - Thank You,
    Denis

  7. #7
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Inserting a space and Suming Macro

    please check attachment, run code "test"
    Attached Files Attached Files

+ 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