Hi all,
VBA beginner here. Wondering how come my codes don't work and I can't find a way to debug it. I thought the code was pretty straight forward but just don't understand how it's not right.
The goal here is simply creating a worksheet called 'Summary', then copy data from A1:C5 from Max, Min, and Projection three worksheets respectively and paste into 'Summary' at 'A1'.
Sub Pasteinto()
Worksheets.Add
Sheets(4).Name = "Summary"
Worksheets("Max").Activate
Worksheets("Max").Range("A1:C5").Select
Selection.Copy
Worksheets("Summary").Activate
Range("A1").Select
ActiveSheet.Paste
Worksheets("Min").Activate
Worksheets("Min").Range("A1:C5").Select
Selection.Copy
Worksheets("Summary").Activate
Range("A6").Select
ActiveSheet.Paste
Worksheets("Projection").Activate
Worksheets("Projection").Range("A1:C5").Select
Selection.Copy
Worksheets("Summary").Activate
Range("A11").Select
ActiveSheet.Paste
End Sub
Of course, if you have an easier way to do this, please tell me so. As you can see, my way is very tedious as I don't know how to incorporate a loop in this procedure.
Thanks for all the help!
Stan
VBA beginner here. Wondering how come my codes don't work and I can't find a way to debug it. I thought the code was pretty straight forward but just don't understand how it's not right.
The goal here is simply creating a worksheet called 'Summary', then copy data from A1:C5 from Max, Min, and Projection three worksheets respectively and paste into 'Summary' at 'A1'.
Sub Pasteinto()
Worksheets.Add
Sheets(4).Name = "Summary"
Worksheets("Max").Activate
Worksheets("Max").Range("A1:C5").Select
Selection.Copy
Worksheets("Summary").Activate
Range("A1").Select
ActiveSheet.Paste
Worksheets("Min").Activate
Worksheets("Min").Range("A1:C5").Select
Selection.Copy
Worksheets("Summary").Activate
Range("A6").Select
ActiveSheet.Paste
Worksheets("Projection").Activate
Worksheets("Projection").Range("A1:C5").Select
Selection.Copy
Worksheets("Summary").Activate
Range("A11").Select
ActiveSheet.Paste
End Sub
Of course, if you have an easier way to do this, please tell me so. As you can see, my way is very tedious as I don't know how to incorporate a loop in this procedure.
Thanks for all the help!
Stan