Copy Specific Cells from a worksheet to a Summary sheet in a workbook

desire32

Board Regular
Joined
May 13, 2010
Messages
61
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!

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
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
Hello,

Is there a question here, or is this just a helpful tidbit you're wanting to post?
 
Upvote 0
Hello,

Is there a question here, or is this just a helpful tidbit you're wanting to post?
thanks Zack,
This is just a helpful tidbit. I earlier on solicited help in doing a similar thing and since I have been able to sort it out with something extra, I decided to post it for the benefit of those who might be in a similar situation.:laugh:
 
Upvote 0

Forum statistics

Threads
1,225,510
Messages
6,185,386
Members
453,289
Latest member
ALPOINT_AIG

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top