Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Excell Issue
Message
 
To
23/04/2003 12:45:15
General information
Forum:
Microsoft Office
Category:
Excel
Title:
Miscellaneous
Thread ID:
00780680
Message ID:
00780779
Views:
12
>I made this document, in excel, and I was wonduring thatHow can I make it that every time
>I send it to print it..it prints with a diferent number(sort of page number)
>
>You know that if a send this doc to print 10 copys, each prints with a different page number.
>
>thanks Ya'll.

You could do something like this example:

In cell A1 have: "Please enter number of pages you want to print-> "
Align that cell right.
In cell B1 have the number of pages to print.
Name the cell B1, NumOfPages
When you name the cell that contains the number of pages, this code will work with the 2 cells just about anywhere you want the page number to show.
Have a button or keystroke run the PrintPages macro below.
'Subs I made because I forget how to do a cell offset all the time
Sub MoveLeft(NumOfCells)
    ActiveCell.Offset(rowOffset:=0, columnOffset:=(-1 * NumOfCells)).Select
End Sub
Sub MoveRight(NumOfCells)
    ActiveCell.Offset(rowOffset:=0, columnOffset:=NumOfCells).Select
End Sub

Sub PrintPages()
    Range("NumOfPages").Select
    NumOfPages = ActiveCell.Value
    MoveLeft (1)
    ActiveCell.Value = "Page: "  'Change prompt temporarily
    MoveRight (1) 'Back to the NumOfPages cell
    For Ctr = 1 To NumOfPages
        ActiveCell.Value = Ctr
        ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
    Next Ctr
    MoveLeft (1)
    'Put the prompt back on the screen.
    'It would be cleaner with a message box now that I think about it.
    'But, this works too.
    ActiveCell.Value = "Please enter number of pages you want to print-> "
End Sub
Hope it helps
___________________________
Kenneth Wonderley
http://www.wonderley.com


...the fruit of the Spirit is love, joy, peace, patience, kindness, goodness, faithfulness, gentleness and self-control.
Galatians 5:22 & 23
Previous
Reply
Map
View

Click here to load this message in the networking platform