Need macro to print sheet with multiple repetitions

B

bill_s1416

I have an excel-based sales report with charts, etc. The territor
number in cell A1 determines the data that populates the tables an
charts. When the user selects a new territory number in cell A1, th
tables and charts update.

I need to print the report for every sales territory every month (5
each month.) I don't want to have to manually select the nex
territory, print, select the next territory, print, etc.

Is there a macro that can automate the process?

:confused
 
R

Ron de Bruin

Hi Bill

This sub will change the value of A1 so all cells will be update.
Print the Sheets("form") and change the value(a1) to the next value......
For Each cell In Sheets("data").Columns("A").SpecialCells(xlCellTypeConstants)
It will use all cells with a territory number in the A column on Sheets("data").
Enter in A1:A50 of Sheets("data") the numbers

Sub test()
Dim cell As Range
For Each cell In Sheets("data").Columns("A").SpecialCells(xlCellTypeConstants)
Sheets("form").Range("A6").Value = cell.Value
Sheets("form").PrintOut
Next
End Sub
 
R

Ron de Bruin

Strange I don't see my first reply
Here it is again
***************************

Hi Bill

This sub will change the value of A1 so all cells will be update.
Print the Sheets("form") and change the value(a1) to the next value......
For Each cell In Sheets("data").Columns("A").SpecialCells(xlCellTypeConstants)
It will use all cells with a territory number in the A column on Sheets("data").
Enter in A1:A50 of Sheets("data") the numbers

Sub test()
Dim cell As Range
For Each cell In Sheets("data").Columns("A").SpecialCells(xlCellTypeConstants)
Sheets("form").Range("A6").Value = cell.Value
Sheets("form").PrintOut
Next
End Sub



--
Regards Ron de Bruin
http://www.rondebruin.nl


Ron de Bruin said:
Typo

In the sub change A6 to A1
Sheets("form").Range("A6").Value = cell.Value
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top