Hi,
I've recorded the macro below.
a) It selects rows 1:52, copies and pastes on the cell A53 (so immediately below the last row that is empty)
b) Selects rows 53:104 copies and pastes on the cell A105 (same number of rows - 52 - starting from the cell immediately below the last row
c) in the cell M59 starts the incremental number with the formula (M5+1)
d) the cells have a special format, including some hidden rows
I need help to be able to past the 52 rows n times, starting from the first cell, column A, below the last row. The n number of times should be a value in the Sheet ("Data").Range ("H1").
Can I have some help to create the routine?
Thanks
Sub Macro3()
'
' Macro3 Macro
'
'
rows("1:52").Select
Selection.Copy
ActiveWindow.SmallScroll Down:=36
Range("A53").Select
ActiveSheet.CheckBoxes.Add(720, 144.75, 19.5, 17.25).Select
ActiveSheet.CheckBoxes.Add(798, 144.75, 19.5, 17.25).Select
ActiveSheet.CheckBoxes.Add(681, 144.75, 19.5, 17.25).Select
ActiveSheet.CheckBoxes.Add(759, 144.75, 19.5, 17.25).Select
ActiveSheet.CheckBoxes.Add(493.5, 338.25, 21.75, 0).Select
ActiveSheet.CheckBoxes.Add(513, 338.25, 21.75, 0).Select
ActiveSheet.CheckBoxes.Add(531, 338.25, 21, 0).Select
ActiveSheet.CheckBoxes.Add(550.5, 338.25, 21, 0).Select
ActiveSheet.CheckBoxes.Add(569.25, 338.25, 21.75, 0).Select
ActiveSheet.CheckBoxes.Add(588.75, 338.25, 21.75, 0).Select
ActiveSheet.CheckBoxes.Add(705.75, 338.25, 21.75, 0).Select
ActiveSheet.CheckBoxes.Add(727.5, 338.25, 21.75, 0).Select
ActiveSheet.CheckBoxes.Add(747, 338.25, 21.75, 0).Select
ActiveSheet.CheckBoxes.Add(765, 338.25, 21, 0).Select
ActiveSheet.CheckBoxes.Add(784.5, 338.25, 21, 0).Select
ActiveSheet.CheckBoxes.Add(803.25, 338.25, 21.75, 0).Select
ActiveSheet.CheckBoxes.Add(822.75, 338.25, 21.75, 0).Select
ActiveSheet.CheckBoxes.Add(471, 338.25, 22.5, 0).Select
ActiveSheet.Paste
Range("M57:P58").Select
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = "=R[-52]C+1"
Range("M59").Select
ActiveWindow.SmallScroll Down:=9
rows("53:104").Select
Selection.Copy
ActiveWindow.SmallScroll Down:=51
Range("A105").Select
ActiveSheet.CheckBoxes.Add(720, 846.75, 19.5, 17.25).Select
ActiveSheet.CheckBoxes.Add(798, 846.75, 19.5, 17.25).Select
ActiveSheet.CheckBoxes.Add(681, 846.75, 19.5, 17.25).Select
ActiveSheet.CheckBoxes.Add(759, 846.75, 19.5, 17.25).Select
ActiveSheet.CheckBoxes.Add(493.5, 1040.25, 21.75, 0).Select
ActiveSheet.CheckBoxes.Add(513, 1040.25, 21.75, 0).Select
ActiveSheet.CheckBoxes.Add(531, 1040.25, 21, 0).Select
ActiveSheet.CheckBoxes.Add(550.5, 1040.25, 21, 0).Select
ActiveSheet.CheckBoxes.Add(569.25, 1040.25, 21.75, 0).Select
ActiveSheet.CheckBoxes.Add(588.75, 1040.25, 21.75, 0).Select
ActiveSheet.CheckBoxes.Add(705.75, 1040.25, 21.75, 0).Select
ActiveSheet.CheckBoxes.Add(727.5, 1040.25, 21.75, 0).Select
ActiveSheet.CheckBoxes.Add(747, 1040.25, 21.75, 0).Select
ActiveSheet.CheckBoxes.Add(765, 1040.25, 21, 0).Select
ActiveSheet.CheckBoxes.Add(784.5, 1040.25, 21, 0).Select
ActiveSheet.CheckBoxes.Add(803.25, 1040.25, 21.75, 0).Select
ActiveSheet.CheckBoxes.Add(822.75, 1040.25, 21.75, 0).Select
ActiveSheet.CheckBoxes.Add(471, 1040.25, 22.5, 0).Select
ActiveSheet.Paste
Application.CutCopyMode = False
rows("105:156").Select
Selection.Copy
ActiveWindow.SmallScroll Down:=45
Range("A157").Select
ActiveSheet.CheckBoxes.Add(720, 1548.75, 19.5, 17.25).Select
ActiveSheet.CheckBoxes.Add(798, 1548.75, 19.5, 17.25).Select
ActiveSheet.CheckBoxes.Add(681, 1548.75, 19.5, 17.25).Select
ActiveSheet.CheckBoxes.Add(759, 1548.75, 19.5, 17.25).Select
ActiveSheet.CheckBoxes.Add(493.5, 1742.25, 21.75, 0).Select
ActiveSheet.CheckBoxes.Add(513, 1742.25, 21.75, 0).Select
ActiveSheet.CheckBoxes.Add(531, 1742.25, 21, 0).Select
ActiveSheet.CheckBoxes.Add(550.5, 1742.25, 21, 0).Select
ActiveSheet.CheckBoxes.Add(569.25, 1742.25, 21.75, 0).Select
ActiveSheet.CheckBoxes.Add(588.75, 1742.25, 21.75, 0).Select
ActiveSheet.CheckBoxes.Add(705.75, 1742.25, 21.75, 0).Select
ActiveSheet.CheckBoxes.Add(727.5, 1742.25, 21.75, 0).Select
ActiveSheet.CheckBoxes.Add(747, 1742.25, 21.75, 0).Select
ActiveSheet.CheckBoxes.Add(765, 1742.25, 21, 0).Select
ActiveSheet.CheckBoxes.Add(784.5, 1742.25, 21, 0).Select
ActiveSheet.CheckBoxes.Add(803.25, 1742.25, 21.75, 0).Select
ActiveSheet.CheckBoxes.Add(822.75, 1742.25, 21.75, 0).Select
ActiveSheet.CheckBoxes.Add(471, 1742.25, 22.5, 0).Select
ActiveSheet.Paste
Application.CutCopyMode = False
End Sub
I've recorded the macro below.
a) It selects rows 1:52, copies and pastes on the cell A53 (so immediately below the last row that is empty)
b) Selects rows 53:104 copies and pastes on the cell A105 (same number of rows - 52 - starting from the cell immediately below the last row
c) in the cell M59 starts the incremental number with the formula (M5+1)
d) the cells have a special format, including some hidden rows
I need help to be able to past the 52 rows n times, starting from the first cell, column A, below the last row. The n number of times should be a value in the Sheet ("Data").Range ("H1").
Can I have some help to create the routine?
Thanks
Sub Macro3()
'
' Macro3 Macro
'
'
rows("1:52").Select
Selection.Copy
ActiveWindow.SmallScroll Down:=36
Range("A53").Select
ActiveSheet.CheckBoxes.Add(720, 144.75, 19.5, 17.25).Select
ActiveSheet.CheckBoxes.Add(798, 144.75, 19.5, 17.25).Select
ActiveSheet.CheckBoxes.Add(681, 144.75, 19.5, 17.25).Select
ActiveSheet.CheckBoxes.Add(759, 144.75, 19.5, 17.25).Select
ActiveSheet.CheckBoxes.Add(493.5, 338.25, 21.75, 0).Select
ActiveSheet.CheckBoxes.Add(513, 338.25, 21.75, 0).Select
ActiveSheet.CheckBoxes.Add(531, 338.25, 21, 0).Select
ActiveSheet.CheckBoxes.Add(550.5, 338.25, 21, 0).Select
ActiveSheet.CheckBoxes.Add(569.25, 338.25, 21.75, 0).Select
ActiveSheet.CheckBoxes.Add(588.75, 338.25, 21.75, 0).Select
ActiveSheet.CheckBoxes.Add(705.75, 338.25, 21.75, 0).Select
ActiveSheet.CheckBoxes.Add(727.5, 338.25, 21.75, 0).Select
ActiveSheet.CheckBoxes.Add(747, 338.25, 21.75, 0).Select
ActiveSheet.CheckBoxes.Add(765, 338.25, 21, 0).Select
ActiveSheet.CheckBoxes.Add(784.5, 338.25, 21, 0).Select
ActiveSheet.CheckBoxes.Add(803.25, 338.25, 21.75, 0).Select
ActiveSheet.CheckBoxes.Add(822.75, 338.25, 21.75, 0).Select
ActiveSheet.CheckBoxes.Add(471, 338.25, 22.5, 0).Select
ActiveSheet.Paste
Range("M57:P58").Select
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = "=R[-52]C+1"
Range("M59").Select
ActiveWindow.SmallScroll Down:=9
rows("53:104").Select
Selection.Copy
ActiveWindow.SmallScroll Down:=51
Range("A105").Select
ActiveSheet.CheckBoxes.Add(720, 846.75, 19.5, 17.25).Select
ActiveSheet.CheckBoxes.Add(798, 846.75, 19.5, 17.25).Select
ActiveSheet.CheckBoxes.Add(681, 846.75, 19.5, 17.25).Select
ActiveSheet.CheckBoxes.Add(759, 846.75, 19.5, 17.25).Select
ActiveSheet.CheckBoxes.Add(493.5, 1040.25, 21.75, 0).Select
ActiveSheet.CheckBoxes.Add(513, 1040.25, 21.75, 0).Select
ActiveSheet.CheckBoxes.Add(531, 1040.25, 21, 0).Select
ActiveSheet.CheckBoxes.Add(550.5, 1040.25, 21, 0).Select
ActiveSheet.CheckBoxes.Add(569.25, 1040.25, 21.75, 0).Select
ActiveSheet.CheckBoxes.Add(588.75, 1040.25, 21.75, 0).Select
ActiveSheet.CheckBoxes.Add(705.75, 1040.25, 21.75, 0).Select
ActiveSheet.CheckBoxes.Add(727.5, 1040.25, 21.75, 0).Select
ActiveSheet.CheckBoxes.Add(747, 1040.25, 21.75, 0).Select
ActiveSheet.CheckBoxes.Add(765, 1040.25, 21, 0).Select
ActiveSheet.CheckBoxes.Add(784.5, 1040.25, 21, 0).Select
ActiveSheet.CheckBoxes.Add(803.25, 1040.25, 21.75, 0).Select
ActiveSheet.CheckBoxes.Add(822.75, 1040.25, 21.75, 0).Select
ActiveSheet.CheckBoxes.Add(471, 1040.25, 22.5, 0).Select
ActiveSheet.Paste
Application.CutCopyMode = False
rows("105:156").Select
Selection.Copy
ActiveWindow.SmallScroll Down:=45
Range("A157").Select
ActiveSheet.CheckBoxes.Add(720, 1548.75, 19.5, 17.25).Select
ActiveSheet.CheckBoxes.Add(798, 1548.75, 19.5, 17.25).Select
ActiveSheet.CheckBoxes.Add(681, 1548.75, 19.5, 17.25).Select
ActiveSheet.CheckBoxes.Add(759, 1548.75, 19.5, 17.25).Select
ActiveSheet.CheckBoxes.Add(493.5, 1742.25, 21.75, 0).Select
ActiveSheet.CheckBoxes.Add(513, 1742.25, 21.75, 0).Select
ActiveSheet.CheckBoxes.Add(531, 1742.25, 21, 0).Select
ActiveSheet.CheckBoxes.Add(550.5, 1742.25, 21, 0).Select
ActiveSheet.CheckBoxes.Add(569.25, 1742.25, 21.75, 0).Select
ActiveSheet.CheckBoxes.Add(588.75, 1742.25, 21.75, 0).Select
ActiveSheet.CheckBoxes.Add(705.75, 1742.25, 21.75, 0).Select
ActiveSheet.CheckBoxes.Add(727.5, 1742.25, 21.75, 0).Select
ActiveSheet.CheckBoxes.Add(747, 1742.25, 21.75, 0).Select
ActiveSheet.CheckBoxes.Add(765, 1742.25, 21, 0).Select
ActiveSheet.CheckBoxes.Add(784.5, 1742.25, 21, 0).Select
ActiveSheet.CheckBoxes.Add(803.25, 1742.25, 21.75, 0).Select
ActiveSheet.CheckBoxes.Add(822.75, 1742.25, 21.75, 0).Select
ActiveSheet.CheckBoxes.Add(471, 1742.25, 22.5, 0).Select
ActiveSheet.Paste
Application.CutCopyMode = False
End Sub