'Calculating Sum of Max. values of Eth column from pivot table values
Dim lastRowE As Long
lastRowE = ActiveSheet.Cells(Rows.Count, 4).End(xlUp).Row
'Excluding grandtotal
lastRowE = lastRowE - 1
Worksheets("pmrrcconnmax").Activate
Cells(1, 5).Value = WorksheetFunction.SumIfs(Range("E7:E" & lastRowE), _
Range("E7:E" & lastRowE), ">0")
'Calculating Sum of Max. values of Fth column from pivot table values
'Dim lastRowF As Long
lastRowF = ActiveSheet.Cells(Rows.Count, 4).End(xlUp).Row
'Excluding grandtotal
lastRowF = lastRowF - 1
'Worksheets("pmrrcconnmax").Activate
Cells(1, 6).Value = WorksheetFunction.SumIfs(Range("F7:F" & lastRowF), _
Range("F7:F" & lastRowF), ">0")
'Calculating Sum of Max. values of Gth column from pivot table values
'Dim lastRowG As Long
lastRowG = ActiveSheet.Cells(Rows.Count, 4).End(xlUp).Row
'Excluding grandtotal
lastRowG = lastRowG - 1
'Worksheets("pmrrcconnmax").Activate
Cells(1, 7).Value = WorksheetFunction.SumIfs(Range("G7:G" & lastRowG), _
Range("G7:G" & lastRowG), ">0")
and so on.... upto Kth column (since I am new to VBA). Can someone help me to find the way to put them in for loop or any other suitable loop?
Thank you in advance