PDA

View Full Version : [SOLVED] Copy and paste total row with engineer name and headings to a new worksheet



rajkumar
02-26-2018, 02:40 AM
Hi ,
i have a report with engineer performance , i need to copy the total row in each engineer with engineer name and parameter heading in vba


Engr Name
Model
Prod Group
Prod Family
CR Calls
Inst. Calls
PM Calls
Total Calls
Brkn Calls
BC Parts
BCTech Engr.
BCTech Alert
BC Emertel
BC Lock
BC Defect
BC Cross Check
BC Appr Await
BC MC Obser
BC In comp
BC Parts Perc.
BC Tech engr.
BC Tech Alert Perc.
BC Other Perc.
Obs. Time
CBC
DBC
Cqm perc.
Job Time
Travel Time
Utilization Factor







Total:
12
0
4
16
0
0
0
0
0
0
0
0
0
0
0
-
-
-
-
0


87.50%
34.15
46.8
46.97



i have attached a copy of the workbook here.
please help
regards
raj21697

MickG
02-26-2018, 04:36 AM
Try this for results on sheet "Summary"


Sub MG26Feb47
Dim Rng As Range, Dn As Range, c As Long
Dim Lst As Long
Application.ScreenUpdating = False
With Sheets("CQM-NAT")
Set Rng = .Range("B2", .Range("B" & Rows.Count).End(xlUp))
Lst = .Cells("1", Columns.Count).End(xlToLeft).Column
End With
c = 1
Range("A1").Resize(, Lst).Copy Sheets("Summary").Range("A1")
For Each Dn In Rng.SpecialCells(xlCellTypeConstants).Areas
With Sheets("Summary")
c = c + 1
Dn(Dn.Count + 1).Offset(, -1).Resize(, Lst).Copy .Cells(c, 1)
Dn(1).Offset(, -1).Copy .Cells(c, 1)
End With
Next Dn
Application.ScreenUpdating = True
End Sub

Regards Mick