+ Reply to Thread
Results 1 to 4 of 4

Sum all data and copy

  1. #1
    Registered User
    Join Date
    03-06-2009
    Location
    Lahore, Pakistan
    MS-Off Ver
    Excel 2003
    Posts
    1

    Question Sum all data and copy

    Dear all,

    I am new to VBA, working on a worksheet and stuck to resolve following query.

    I have a worksheet with important data that we update daily and just want to add a column at the end of the sheet.

    Requirement:

    Have Raw data in other sheet and want VBA to first find and sum similar variables (unique code is defined for each item). Copy them to another place or if they can directly copied to the origional sheet in the required column.

    Example:
    Raw data
    Data is in different columns (e.g. code = Column D, Description = column F and qty = column Q)
    Now what i want is it find and sum all the items with same code and make a new sheet like below:

    Code Item description Qty

    and with the help of vlookup (or any other way through VBA), it copies the Qty data comparing code to the actual sheet in the column added at the last of the sheet. One thing i am concerned with i dont want to increase the size of my origional file so planning to practise it with VBA rather than vlookup just to reduce the size and routine efforts.

    I hope i have communicated my question properly and is easily understandable, if you feel something confusing please ask. I am looking for its solution i am not a business professional but have to do it and it seems difficult for me. Thanks

  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: Sum all data and copy

    Someone may offer a macro approach, but I would construct this with a single helper "key" column added to my Data sheet to give all the items a unique numerical flag starting at 1 and rising.

    With that, a simple INDEX/MATCH (speedy fast formula) can spot the first entry of each index key, insert the matching ITEM # in the row that matches that index. Then the Desc is another simple INDEX/MATCH on that ITEM # and the QTY TOTAL is standard SUMIF formula.

    All of these functions are very low overhead, so your SUMMARY would stay updated all the time with no macros to run. You could even add a little "flag" at the top of the SUMMARY to remind you when the SUMMARY table needs to be lengthened. (included in the sample sheet attached)

    A sample is attached. It's pretty low maintenance.
    Attached Files Attached Files
    _________________
    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 JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Sum all data and copy

    Cross post without a proper cross link:
    http://www.mrexcel.com/forum/showthread.php?t=375772

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Sum all data and copy

    Excelsupport:

    Your post does not comply with Rule 8 of our Forum RULES. Cross-posting is when you post the same question in other forums on the web. You'll find people are disinclined to respond to cross-posts because they may be wasting their time solving a problem that has been solved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you MUST provide a link (copy the url from the address bar in your browser)to the cross-post. Expect cross-posts without a link to be closed a message will be posted by the moderator explaining why. We are here to help so help us help you!
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

+ 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