Here's a macro to get this done

Sub Consolidator()

    Dim rngStart As Range

    Application.ScreenUpdating = 0
    Range("F1").CurrentRegion.Clear
    With Cells.Find(What:="Machine", Lookat:=xlWhole,
searchDirection:=xlNext, After:=Cells(1))
    Set rngStart = Range(.Offset(1), .Offset(, 1).End(xlDown).Offset(, -1))
    End With
    On Error Resume Next
    rngStart.SpecialCells(xlCellTypeBlanks).FormulaR1C1 = "=r[-1]c"
    Err.Clear: On Error GoTo -1: On Error GoTo 0
    With Range("F1")
        .Resize(rngStart.Rows.Count + 1, 2).Value =
rngStart(0).Resize(rngStart.Rows.Count + 1, 2).Value
        .CurrentRegion.RemoveDuplicates Columns:=Array(1, 2), Header:=xlYes
        .Offset(, 2).Resize(1, 2).Value = rngStart(0).Offset(, 2).Resize(1,
2).Value
        With .Offset(1, 2).Resize(.CurrentRegion.Rows.Count - 1, 2)
            .Formula = "=SUMPRODUCT(--(" & rngStart.Address & "=$F2),--(" &
rngStart.Offset(, 1).Address & "=$G2)," & rngStart.Offset(, 2).Address(1,
0) & ")"
            .Value = .Value
        End With
    End With
    On Error Resume Next
    rngStart.SpecialCells(xlCellTypeFormulas).ClearContents
    Err.Clear: On Error GoTo -1: On Error GoTo 0
    Application.ScreenUpdating = 1

End Sub

Regards,

Sam Mathai Chacko

On Sun, Nov 27, 2011 at 6:40 PM, rajan verma <rajanverma1...@gmail.com>wrote:

> Hi
> Please see the attached file.. Pivot table can be used for this ..
>
> Regards
> Rajan
>
> On Sat, Nov 26, 2011 at 8:23 PM, son nguyen <sonnguye...@gmail.com> wrote:
>
>> Dear all,
>>
>>
>> I have problem of calculating sheet.Detail as sheet attached.
>> I want to have a macro to sum value within qty, and downtime column then
>> delete products are duplicated within each machine.
>>
>> I look foward to hear your help asap
>>
>>
>> Best Regards
>> Son
>>
>> --
>> FORUM RULES (934+ members already BANNED for violation)
>>
>> 1) Use concise, accurate thread titles. Poor thread titles, like Please
>> Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice
>> will not get quick attention or may not be answered.
>>
>> 2) Don't post a question in the thread of another member.
>>
>> 3) Don't post questions regarding breaking or bypassing any security
>> measure.
>>
>> 4) Acknowledge the responses you receive, good or bad.
>>
>> 5) Cross-promotion of, or links to, forums competitive to this forum in
>> signatures are prohibited.
>>
>> NOTE : Don't ever post personal or confidential data in a workbook. Forum
>> owners and members are not responsible for any loss.
>>
>>
>> ------------------------------------------------------------------------------------------------------
>> To post to this group, send email to excel-macros@googlegroups.com
>>
>
>
>
> --
> Regards
> Rajan verma
> +91 9158998701
>
> --
> FORUM RULES (934+ members already BANNED for violation)
>
> 1) Use concise, accurate thread titles. Poor thread titles, like Please
> Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice
> will not get quick attention or may not be answered.
>
> 2) Don't post a question in the thread of another member.
>
> 3) Don't post questions regarding breaking or bypassing any security
> measure.
>
> 4) Acknowledge the responses you receive, good or bad.
>
> 5) Cross-promotion of, or links to, forums competitive to this forum in
> signatures are prohibited.
>
> NOTE : Don't ever post personal or confidential data in a workbook. Forum
> owners and members are not responsible for any loss.
>
>
> ------------------------------------------------------------------------------------------------------
> To post to this group, send email to excel-macros@googlegroups.com
>



-- 
Sam Mathai Chacko

-- 
FORUM RULES (934+ members already BANNED for violation)

1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
quick attention or may not be answered.

2) Don't post a question in the thread of another member.

3) Don't post questions regarding breaking or bypassing any security measure.

4) Acknowledge the responses you receive, good or bad.

5)  Cross-promotion of, or links to, forums competitive to this forum in 
signatures are prohibited. 

NOTE  : Don't ever post personal or confidential data in a workbook. Forum 
owners and members are not responsible for any loss.

------------------------------------------------------------------------------------------------------
To post to this group, send email to excel-macros@googlegroups.com

Attachment: Consolidate Machine Products Qty DownTime.xlsm
Description: Binary data

Reply via email to