ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Printing a sequence of pages (https://www.excelbanter.com/excel-programming/293435-printing-sequence-pages.html)

Retail Mike

Printing a sequence of pages
 
I have data associated with a number of districts. Each
district will have from 10 to 25 subsheets to print,
depending on the number of outlets in that district.

I have a listing of outlest reporting to each district in
a sheet.
a b c
Dist 1 Dist 2 Dist 3
101 201 301
102 202 302
103 203 303
204 304
205

The actual reporting outlets are subject to change
districts at any time, with a number of additions and
deletions in each district-(so the listings of outlets are
not fixed in length.)I can put the listings anywhere on
the workbook as they are downloaded periodically.

The actual number of districts will increase over time.

I currently report performance for each outlet within any
district on seperate sheets, with a final sheet for the
district totals. (I have no issues with developing the
totals, but rather the printing of sheets)

I currently print through use of a recorded macro, but
have "hardcoded" each sheet's macro into the procedure,
requiring me to copy and paste a new routine, or delete a
routine, with each change in the reporting structure.

I am seaching for code that will read the list beneath
each district, copy the outlet number into the page to be
printed [which will update the data being printed, as well
as identify the outlet (all handled)] until it reaches the
end of the list, then moves to the next district, doing
the same, until the final district is completed. (Then
exits the routine).

I would appreciate any code or advise with this routine.

Mike





Dick Kusleika[_3_]

Printing a sequence of pages
 
Mike

You have just one sheet for reporting, and you change a cell on that sheet
depending on which outlet you want to report? It sounds like you need
something like this:

Dim rDist as Range
Dim rOut as Range
Dim rAllOut as Range

For Each rDist in Range("A1:C1")
Set rAllOutRange =
Range(rDist.Offset(1,0),Cells(65536,rDist.Column). End(xlUp))
For Each rOut in rAllOut.Cells
Sheets("Report").Range("A1").Value = rOut.Value
Sheets("Report").PrintOut
Next rOut
Next rDist

--
Dick Kusleika
MVP - Excel
www.dicks-clicks.com
Post all replies to the newsgroup.

"Retail Mike" wrote in message
...
I have data associated with a number of districts. Each
district will have from 10 to 25 subsheets to print,
depending on the number of outlets in that district.

I have a listing of outlest reporting to each district in
a sheet.
a b c
Dist 1 Dist 2 Dist 3
101 201 301
102 202 302
103 203 303
204 304
205

The actual reporting outlets are subject to change
districts at any time, with a number of additions and
deletions in each district-(so the listings of outlets are
not fixed in length.)I can put the listings anywhere on
the workbook as they are downloaded periodically.

The actual number of districts will increase over time.

I currently report performance for each outlet within any
district on seperate sheets, with a final sheet for the
district totals. (I have no issues with developing the
totals, but rather the printing of sheets)

I currently print through use of a recorded macro, but
have "hardcoded" each sheet's macro into the procedure,
requiring me to copy and paste a new routine, or delete a
routine, with each change in the reporting structure.

I am seaching for code that will read the list beneath
each district, copy the outlet number into the page to be
printed [which will update the data being printed, as well
as identify the outlet (all handled)] until it reaches the
end of the list, then moves to the next district, doing
the same, until the final district is completed. (Then
exits the routine).

I would appreciate any code or advise with this routine.

Mike








All times are GMT +1. The time now is 11:28 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com