Hi
Here's my current code;
What I'm trying to do is go through each sheet name ending with "3CT" and copy the non-adjacent ranges defined above and paste into the next blank row within Worksheet "3CT Objective". But, It won't let me copy multiple selections.
I've tried looking around but anything I try doesn't seem to work!
This is my manual code which does work (but given I'd have to write / adapt 30+ times is something like 2400+ different lines so trying to shorten it). The "Name" also varies by sheet but the 3CT is always present in the sheet name;
Any help would be appreciated!
Here's my current code;
Code:
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets
If ws.Name Like "*3CT" Then
ws.Range("A29,C29,E29,G29,J29,N29,A34,C34,A36,C36,A38,C38").Copy
Sheets("3CT Objectives").Cells(Rows.Count, "B").End(xlUp).Offset(1).PasteSpecial xlPasteValues
ws.Range("A67,C67,E67,G67,J67,N67,A72,C72,A74,C74,A76,C76").Copy
Sheets("3CT Objectives").Cells(Rows.Count, "B").End(xlUp).Offset(1).PasteSpecial xlPasteValues
ws.Range("A105,C105,E105,G105,J105,N105,A110,C110,A112,C112,A114,C114").Copy
Sheets("3CT Objectives").Cells(Rows.Count, "B").End(xlUp).Offset(1).PasteSpecial xlPasteValues
ws.Range("A143,C143,E143,G143,J143,N143,A148,C148,A150,C150,A152,C152").Copy
Sheets("3CT Objectives").Cells(Rows.Count, "B").End(xlUp).Offset(1).PasteSpecial xlPasteValues
ws.Range("A181,C181,E181,G181,J181,N181,A186,C186,A188,C188,A190,C190").Copy
Sheets("3CT Objectives").Cells(Rows.Count, "B").End(xlUp).Offset(1).PasteSpecial xlPasteValues
ws.Range("A219,C219,E219,G219,J219,N219,A224,C224,A226,C226,A228,C228").Copy
Sheets("3CT Objectives").Cells(Rows.Count, "B").End(xlUp).Offset(1).PasteSpecial xlPasteValues
End If
Next
Exit Sub
What I'm trying to do is go through each sheet name ending with "3CT" and copy the non-adjacent ranges defined above and paste into the next blank row within Worksheet "3CT Objective". But, It won't let me copy multiple selections.
I've tried looking around but anything I try doesn't seem to work!
This is my manual code which does work (but given I'd have to write / adapt 30+ times is something like 2400+ different lines so trying to shorten it). The "Name" also varies by sheet but the 3CT is always present in the sheet name;
Code:
ActiveSheet.Range("A5") = "Name"
ActiveSheet.Range("B5") = Worksheets("Name 3CT").Range("A29")
ActiveSheet.Range("C5") = Worksheets("Name 3CT").Range("C29")
ActiveSheet.Range("D5") = Worksheets("Name 3CT").Range("E29")
ActiveSheet.Range("E5") = Worksheets("Name 3CT").Range("G29")
ActiveSheet.Range("F5") = Worksheets("Name 3CT").Range("J29")
ActiveSheet.Range("G5") = Worksheets("Name 3CT").Range("N29")
ActiveSheet.Range("H5") = Worksheets("Name 3CT").Range("A34")
ActiveSheet.Range("I5") = Worksheets("Name 3CT").Range("C34")
ActiveSheet.Range("J5") = Worksheets("Name 3CT").Range("A36")
ActiveSheet.Range("K5") = Worksheets("Name 3CT").Range("C36")
ActiveSheet.Range("L5") = Worksheets("Name 3CT").Range("A38")
ActiveSheet.Range("M5") = Worksheets("Name 3CT").Range("C38")
ActiveSheet.Range("A6") = "Name"
ActiveSheet.Range("B6") = Worksheets("Name 3CT").Range("A67")
ActiveSheet.Range("C6") = Worksheets("Name 3CT").Range("C67")
ActiveSheet.Range("D6") = Worksheets("Name 3CT").Range("E67")
ActiveSheet.Range("E6") = Worksheets("Name 3CT").Range("G67")
ActiveSheet.Range("F6") = Worksheets("Name 3CT").Range("J67")
ActiveSheet.Range("G6") = Worksheets("Name 3CT").Range("N67")
ActiveSheet.Range("H6") = Worksheets("Name 3CT").Range("A72")
ActiveSheet.Range("I6") = Worksheets("Name 3CT").Range("C72")
ActiveSheet.Range("J6") = Worksheets("Name 3CT").Range("A74")
ActiveSheet.Range("K6") = Worksheets("Name 3CT").Range("C74")
ActiveSheet.Range("L6") = Worksheets("Name 3CT").Range("A76")
ActiveSheet.Range("M6") = Worksheets("Name 3CT").Range("C76")
ActiveSheet.Range("A7") = "Name"
ActiveSheet.Range("B7") = Worksheets("Name 3CT").Range("A105")
ActiveSheet.Range("C7") = Worksheets("Name 3CT").Range("C105")
ActiveSheet.Range("D7") = Worksheets("Name 3CT").Range("E105")
ActiveSheet.Range("E7") = Worksheets("Name 3CT").Range("G105")
ActiveSheet.Range("F7") = Worksheets("Name 3CT").Range("J105")
ActiveSheet.Range("G7") = Worksheets("Name 3CT").Range("N105")
ActiveSheet.Range("H7") = Worksheets("Name 3CT").Range("A110")
ActiveSheet.Range("I7") = Worksheets("Name 3CT").Range("C110")
ActiveSheet.Range("J7") = Worksheets("Name 3CT").Range("A112")
ActiveSheet.Range("K7") = Worksheets("Name 3CT").Range("C112")
ActiveSheet.Range("L7") = Worksheets("Name 3CT").Range("A114")
ActiveSheet.Range("M7") = Worksheets("Name 3CT").Range("C114")
ActiveSheet.Range("A8") = "Name"
ActiveSheet.Range("B8") = Worksheets("Name 3CT").Range("A143")
ActiveSheet.Range("C8") = Worksheets("Name 3CT").Range("C143")
ActiveSheet.Range("D8") = Worksheets("Name 3CT").Range("E143")
ActiveSheet.Range("E8") = Worksheets("Name 3CT").Range("G143")
ActiveSheet.Range("F8") = Worksheets("Name 3CT").Range("J143")
ActiveSheet.Range("G8") = Worksheets("Name 3CT").Range("N143")
ActiveSheet.Range("H8") = Worksheets("Name 3CT").Range("A148")
ActiveSheet.Range("I8") = Worksheets("Name 3CT").Range("C148")
ActiveSheet.Range("J8") = Worksheets("Name 3CT").Range("A150")
ActiveSheet.Range("K8") = Worksheets("Name 3CT").Range("C150")
ActiveSheet.Range("L8") = Worksheets("Name 3CT").Range("A152")
ActiveSheet.Range("M8") = Worksheets("Name 3CT").Range("C152")
ActiveSheet.Range("A9") = "Name"
ActiveSheet.Range("B9") = Worksheets("Name 3CT").Range("A181")
ActiveSheet.Range("C9") = Worksheets("Name 3CT").Range("C181")
ActiveSheet.Range("D9") = Worksheets("Name 3CT").Range("E181")
ActiveSheet.Range("E9") = Worksheets("Name 3CT").Range("G181")
ActiveSheet.Range("F9") = Worksheets("Name 3CT").Range("J181")
ActiveSheet.Range("G9") = Worksheets("Name 3CT").Range("N181")
ActiveSheet.Range("H9") = Worksheets("Name 3CT").Range("A186")
ActiveSheet.Range("I9") = Worksheets("Name 3CT").Range("C186")
ActiveSheet.Range("J9") = Worksheets("Name 3CT").Range("A188")
ActiveSheet.Range("K9") = Worksheets("Name 3CT").Range("C188")
ActiveSheet.Range("L9") = Worksheets("Name 3CT").Range("A190")
ActiveSheet.Range("M9") = Worksheets("Name 3CT").Range("C190")
ActiveSheet.Range("A10") = "Name"
ActiveSheet.Range("B10") = Worksheets("Name 3CT").Range("A219")
ActiveSheet.Range("C10") = Worksheets("Name 3CT").Range("C219")
ActiveSheet.Range("D10") = Worksheets("Name 3CT").Range("E219")
ActiveSheet.Range("E10") = Worksheets("Name 3CT").Range("G219")
ActiveSheet.Range("F10") = Worksheets("Name 3CT").Range("J219")
ActiveSheet.Range("G10") = Worksheets("Name 3CT").Range("N219")
ActiveSheet.Range("H10") = Worksheets("Name 3CT").Range("A224")
ActiveSheet.Range("I10") = Worksheets("Name 3CT").Range("C224")
ActiveSheet.Range("J10") = Worksheets("Name 3CT").Range("A226")
ActiveSheet.Range("K10") = Worksheets("Name 3CT").Range("C226")
ActiveSheet.Range("L10") = Worksheets("Name 3CT").Range("A228")
ActiveSheet.Range("M10") = Worksheets("Name 3CT").Range("C228")
Any help would be appreciated!