![]() |
|
|
|
#1
|
|||
|
|||
|
hello All,
new here. I am trying to print a single worksheet, but would like to have each page be sequentially numbered. so: same sheet, each copy with a new number read about VBA, but don't fully understand Thanks for any help, Mark |
|
#2
|
|||
|
|||
|
Something like this should be able to get you started.
Code:
Sub PrintAndNumber()
Dim totalSheets As Integer, rangeForNumber As Range, rangeString As String
Dim x As Integer, wb As Workbook, ws As Worksheet
'change how many sheets you want here.
totalSheets = 5
'change the cell where you want the page number to go
rangeString = "A1"
'auto setup
Set wb = ThisWorkbook
Set ws = wb.ActiveSheet
Set rangeForNumber = ws.Range(rangeString)
For x = 1 To totalSheets
rangeForNumber.Value = x
ws.PrintOut
Next x
End Sub
Thanks |
|
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Sequentially number 100 pages of a document
|
webba0264 | Word VBA | 10 | 02-17-2017 02:27 PM |
Appending unique data from one worksheet to existing data on another worksheet
|
EdStockton | Excel | 1 | 08-06-2014 11:00 PM |
| Sequentially numbered copies of multi-page word document | Mark Paterson | Word VBA | 3 | 05-16-2014 04:34 PM |
Sequentially numbering a document
|
UniAdmin | Word VBA | 1 | 02-21-2013 07:25 PM |
How to summarise different worksheet to a summary worksheet
|
samkiewhock | Excel | 1 | 09-06-2012 03:34 AM |