-
Hi Jason,
Welcome to VBAX
Give this a try
[VBA]
Sub Macro1()
Dim sh1 As Worksheet
Dim sh2 As Worksheet
Dim Rng As Range
Set sh1 = Sheets(1)
Set sh2 = Sheets(2)
Set Rng = Range(sh1.Cells(1, 1), sh1.Cells(Rows.Count, 1).End(xlUp))
sh1.Range("A1:G1").Copy sh2.Range("A1")
Rng.AdvancedFilter Action:=xlFilterCopy, CopyToRange:=sh2.Range("A1"), Unique:=True
Set Rng = Range(sh2.Cells(2, 1), sh2.Cells(Rows.Count, 1).End(xlUp))
Rng.Offset(, 1).Resize(, 6).FormulaR1C1 = "=SUMIF(Sheet1!C1,Sheet2!RC1,Sheet1!C)"
End Sub
[/VBA]
MVP (Excel 2008-2010)
Post a workbook with sample data and layout if you want a quicker solution.
To help indent your macros try Smart Indent
Please remember to mark threads 'Solved'
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules