LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10
Default How do I get a number to change after each print?

Sorry I spoke to soon...I typed the code in just as you said but it still
doesn't change the number. I still don't know what I am doing wrong? Do you
have any ideas. Thanks Jennifer

"Nick Hodge" wrote:

Jennifer

You can use a Workbook_BeforePrint() event. To implement right click on the
Excel icon at the top left of the workbook (not the application icon) and
select view code. Paste it in the resulting window

You will need to change the worksheet name from ShippingData to the actual
one and the cell from A1 to whatever it is (in two places). Now each time
you *before* you print, that number will increment by 1

Private Sub Workbook_BeforePrint(Cancel As Boolean)
If ActiveSheet.Name = "ShippingData" Then
ActiveSheet.Range("A1").Value = ActiveSheet.Range("A1").Value + 1
End If
End Sub

--

HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
DTHIS
web:
www.nickhodge.co.uk
blog (non tech): www.nickhodge.co.uk/blog


"Jennifer-Houston, TX" <Jennifer-Houston,
wrote in message ...
I am trying to set of a shipping form. I want to know if there is a format
in
which I can have a number on the top of my page and it change after every
print I print. I don't know if I am explaining this well so I will give an
example:
No. 26786 for the first print and when I close it and open it again I
want
the number to change to 26787 and so on. I don't want to keep using the
same
number it will get hard to track pacakges. I believe this is possible I
just
don't know how....any help would be greatly appreciated!!! :)
Thanks,
Jennifer - Houston, TX



 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
need a print macro to print only a certain number of pages Tonso Excel Discussion (Misc queries) 2 July 26th 06 06:03 PM
remove cr character from a + number and change number to - 159cr Cr character on numbers Excel Worksheet Functions 3 March 10th 06 10:34 PM
How do I change a number in one cell to change a series of cells? lance559 Excel Discussion (Misc queries) 2 January 13th 06 08:56 PM
How do I change a social security number to a number series? LCDawn Excel Discussion (Misc queries) 4 December 22nd 05 04:15 PM
change info in other cells when i change a number in a drop list? macbr549 Excel Discussion (Misc queries) 2 September 11th 05 02:07 AM


All times are GMT +1. The time now is 12:46 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"