wallyxl
Board Regular
- Joined
- Apr 24, 2011
- Messages
- 100
Hello everyone,
I have recorded a macro and it works fine.
I have 18 sheets that are numbered 1 through to 18.
I would like this macro to loop through each sheet from 1 to 18 as I will need to extract data from each sheet about 4 times (I can change the range(D25) each time I run it.
Thank you.
I have recorded a macro and it works fine.
I have 18 sheets that are numbered 1 through to 18.
I would like this macro to loop through each sheet from 1 to 18 as I will need to extract data from each sheet about 4 times (I can change the range(D25) each time I run it.
Thank you.
Code:
Sheets("18").Select
Range("D25").Select
Selection.Copy
ActiveCell.Offset(65, 0).Range("A1").Select
ActiveSheet.Paste
ActiveCell.Offset(-65, 2).Range("A1").Select
Application.CutCopyMode = False
Selection.Copy
ActiveCell.Offset(65, -3).Range("A1").Select
ActiveSheet.Paste
ActiveCell.Offset(-62, 2).Range("A1:D7").Select
Application.CutCopyMode = False
Selection.Copy
ActiveCell.Offset(62, 0).Range("A1").Select
ActiveSheet.Paste
ActiveCell.Offset(-62, 23).Range("A1:B7").Select
Application.CutCopyMode = False
Selection.Copy
ActiveCell.Offset(62, -19).Range("A1").Select
ActiveSheet.Paste
ActiveCell.Offset(0, -6).Range("A1:B1").Select
Application.CutCopyMode = False
Selection.Copy
ActiveCell.Offset(1, 0).Range("A1:A6").Select
ActiveSheet.Paste
ActiveCell.Rows("1:1").EntireRow.Select
Application.CutCopyMode = False
Selection.Delete Shift:=xlUp
ActiveCell.Offset(1, 0).Rows("1:1").EntireRow.Select
Selection.Delete Shift:=xlUp
ActiveCell.Offset(1, 0).Rows("1:1").EntireRow.Select
Selection.Delete Shift:=xlUp
ActiveCell.Offset(-3, 2).Range("A1:H4").Select
Selection.Cut
Sheets("Catchall").Select
Range("A1").Select
Selection.End(xlDown).Select
ActiveCell.Offset(1, 0).Range("A1").Select
ActiveSheet.Paste
ActiveCell.Select
Selection.End(xlUp).Select
End Sub
Last edited by a moderator: