This macro is a product of me comparing worksheet names in a Summary sheet to the wiorksheets in the workbook and if they match , copy specific cells from that worksheet onto the Summary sheet corresponding to the worksheet name. Worked for me and I am putting it here in case you one might need it!
Max Respect!
Max Respect!
Code:
Private Sub CopyToSummarySheet()
Dim SheetName As String
Worksheets("Summary").Activate
Application.DisplayAlerts = False
For j = 2 To Worksheets.Count
TName = Sheets(j).name
Sheets(TName).Activate
'load data into parameters
QA = Range("H18").Value
NC = Range("I3").Value
AErr = Range("J18").Value
NCErr = Range("I2").Value
ARec = Range("N18").Value
Worksheets("Summary").Activate
For i = 1 To 12
If TName = Cells(1 + i, 1).Value Then
Cells(1 + i, 2) = QA
Cells(1 + i, 3) = NC
Cells(1 + i, 4) = AE
Cells(1 + i, 5) = NCErr
Cells(1 + i, 6) = ARec
Else: End If
Next i
Next j
Application.DisplayAlerts = True
End Sub