Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 07-28-2016, 08:42 AM
kromertma kromertma is offline sequentially numbering one worksheet Windows 7 64bit sequentially numbering one worksheet Office 2013
Novice
sequentially numbering one worksheet
 
Join Date: Jul 2016
Posts: 1
kromertma is on a distinguished road
Default sequentially numbering one worksheet

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
Reply With Quote
  #2  
Old 08-02-2016, 12:01 AM
excelledsoftware excelledsoftware is offline sequentially numbering one worksheet Windows 10 sequentially numbering one worksheet Office 2007
IT Specialist
 
Join Date: Jan 2012
Location: Utah
Posts: 455
excelledsoftware will become famous soon enough
Default

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
Let me know if you have any questions.

Thanks
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
sequentially numbering one worksheet Sequentially number 100 pages of a document webba0264 Word VBA 10 02-17-2017 02:27 PM
sequentially numbering one worksheet 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 one worksheet Sequentially numbering a document UniAdmin Word VBA 1 02-21-2013 07:25 PM
sequentially numbering one worksheet How to summarise different worksheet to a summary worksheet samkiewhock Excel 1 09-06-2012 03:34 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:27 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft