szita2000
Board Regular
- Joined
- Apr 25, 2012
- Messages
- 101
- Office Version
- 365
- Platform
- Windows
Hi Guys.
I have a sheet with Raw data dumped in. (ever changing number of rows)
I need to break this raw data out to printable templates. (Not simple headers but a silly sign off sheet. - otherwise I would try to print titles)
What I did is to make 10 worksheets with empty templates where I increased the number of empty template sheets. (First sheet is 1 page template, second is 2 sheets and so on)
I am stuck with the part where I take the raw data from row 2 to lastrow on the raw data sheet, offset a range with 18 rows then copy it across the correct sheet to the correct place.
I can't figure out how to use loop and/or offset maybe on the raw data page to jump by 18 rows rows but paste it to rows 9:26 then to 41:58 then to 72:89 and so on.
I managed to determine the number of sheets I need by this:
The idea behind this was so I can use the page numbers to concatenate it in a loop for the destination.
My sheets are named "Template1", "Template2" and so on.
I have a sheet with Raw data dumped in. (ever changing number of rows)
I need to break this raw data out to printable templates. (Not simple headers but a silly sign off sheet. - otherwise I would try to print titles)
What I did is to make 10 worksheets with empty templates where I increased the number of empty template sheets. (First sheet is 1 page template, second is 2 sheets and so on)
I am stuck with the part where I take the raw data from row 2 to lastrow on the raw data sheet, offset a range with 18 rows then copy it across the correct sheet to the correct place.
I can't figure out how to use loop and/or offset maybe on the raw data page to jump by 18 rows rows but paste it to rows 9:26 then to 41:58 then to 72:89 and so on.
I managed to determine the number of sheets I need by this:
Code:
Public TemplatePage As Integer
Public ValidateRange As Range
Sub ValidateNumberofRows()
Set ValidateRange = Sheets("DataDump").Range("A2", Sheets("DataDump").Range("A2").End(xlDown))
TemplatePage = Application.RoundUp((ValidateRange.Rows.Count / 18), 0)
Call copy
End Sub
The idea behind this was so I can use the page numbers to concatenate it in a loop for the destination.
My sheets are named "Template1", "Template2" and so on.