+ Reply to Thread
Results 1 to 3 of 3

vba program required to sum and transform my data based on 3 criteria

  1. #1
    Registered User
    Join Date
    06-20-2015
    Location
    Chennai, India
    MS-Off Ver
    2010
    Posts
    59

    vba program required to sum and transform my data based on 3 criteria

    Dear All,

    Please find attached my requirement. The source sheet contains the source data and the same needs to be transformed to the format which is available in OUTPUT sheet. There are 3 conditions.. 1.Rep Period 2.PID 3.ORIGLT.... if all these 3 matches for the subsequent rows in source sheet then needs to be sumup all the columns from D thru S and place it in OUTPUT. If Rep Period & PID is matching and ORIGLT not matching for subsequent then in the same table next row to be updated based on the ORIGLT value. IF PID is not matching for subsequent rows then the same table needs to copy pasted in the right side for the same Rep Period (as these two PIDs belongs to same period) and sum up paste the data based on the ORIGLT. Finally if the Rep Period is not matching with the subsequent rows, then we need to copy the entire first table and paste the same in the bottom and sum up based on ORIGLT and paste in OUTPUT.

    I have prepared the OUTPUT sheet using the formulas only, so everything will be clear if you have a look at the source / output.

    Thanks a lot for your help and continuous support.
    Attached Files Attached Files

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: vba program required to sum and transform my data based on 3 criteria

    Does the attached help.

    This sort of analysis is much easier with a Pivot Table, which also gives you a lot more flexibility for reporting the data in different ways just by dragging and dropping field names around. The PT needs the data in a different layout which is the new sheet called 'Data'
    Attached Files Attached Files
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    06-20-2015
    Location
    Chennai, India
    MS-Off Ver
    2010
    Posts
    59

    Re: vba program required to sum and transform my data based on 3 criteria

    Dear Sir,

    Thanks for your quick response.

    We had used pivot tables for this analysis earlier, but due to several practical difficulties and higher management's directive i have been asked to write the VBA CODE. Hence it would be grateful if you could help me to complete the same in VBA.

    Thanks a lot for your understanding and help.

+ 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. [SOLVED] Msg Box required based on criteria
    By kannan1847 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-25-2016, 04:43 AM
  2. [SOLVED] Help required for rate check on hotel based on 3 criteria
    By wendor in forum Excel General
    Replies: 12
    Last Post: 10-25-2015, 09:48 PM
  3. [SOLVED] VBA MsgBox pop up required based on two criteria.
    By Declamatory in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-14-2015, 08:57 AM
  4. VBA Program to Compare 4 Columns in Excel (Required)
    By vijaysram in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-22-2013, 12:37 PM
  5. Program to copy certain data that meets criteria into new spreadsheet?
    By hellokitty123 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-02-2010, 08:48 PM
  6. program not extracting required info
    By WasWodge in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-11-2010, 07:00 PM
  7. Cutting Pipe lengths VBA program required
    By ldavison10 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-18-2008, 10:00 AM

Tags for this Thread

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