Hi All
I have a vba code for sumifs for data and summary sheet in yellow tabs, Macro found on summary sheet (yellow)
Need to adjust macro for red tabs data_1 and summary report_1. Columns involved in data_1 are columns H,I,J,K,Min blue.
An advanced filter for unique records is made through macro with their respective headers in summary report _1
Can anyone help to adjust code for summary report_1 columns involved are D and E in red as attached
I have a vba code for sumifs for data and summary sheet in yellow tabs, Macro found on summary sheet (yellow)
Need to adjust macro for red tabs data_1 and summary report_1. Columns involved in data_1 are columns H,I,J,K,Min blue.
An advanced filter for unique records is made through macro with their respective headers in summary report _1
Can anyone help to adjust code for summary report_1 columns involved are D and E in red as attached
Code:
Sub RAM()
Dim LastR As Long
Dim ws1 As Worksheet, ws2 As Worksheet
Set ws1 = Sheets("data")
Set ws2 = Sheets("summary")
LastR = ws1.Cells(Rows.Count, 1).End(xlUp).Row
With ws2
.Range("A1:E1").Value = ws1.Range("A1:E1").Value
.Range(.Range("A2"), .Cells(LastR, 4)).Value = ws1.Range(ws1.Range("A2"), ws1.Cells(LastR, 4)).Value
.Range(.Range("A2"), .Cells(LastR, 4)).RemoveDuplicates Columns:=Array(1, 2, 3, 4), Header:=xlNo
LastR = .Cells(Rows.Count, 1).End(xlUp).Row
.Range(.Range("E2"), .Cells(LastR, 5)).Value = _
"=SUMIFS(data!C,data!C[-4],RC[-4],data!C[-3],RC[-3],data!C[-2],RC[-2],data!C[-1],RC[-1])"
.Range(.Range("E2"), .Cells(LastR, 5)).Value = .Range(.Range("E2"), .Cells(LastR, 5)).Value
End With
End Sub