ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   auto number roll over? (https://www.excelbanter.com/excel-worksheet-functions/122579-auto-number-roll-over.html)

Roger

auto number roll over?
 
strange request he

I have a sheet that is numbered in a cell and I was wondering if there is
anyway to advance that number by 1 whenever the sheet is printed (best
solution).
OR
any other suggestion would be great. These are forms that I need to
identify individually and I'm being lazy about having to remember to change
the number identifier each time

Thanks in advance

Paul B

auto number roll over?
 
Roger, you could use some code like this in the before print event,

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Sheets("Sheet1").Range("A1").Value = _
Sheets("Sheet1").Range("A1").Value + 1
End Sub


To put in this macro, from your workbook right-click the workbook's icon and
pick View Code. This icon is at the top-left of the spreadsheet this will
open the VBA editor to the thisworkbook module, then, paste the code in the
window that opens on the right hand side, press Alt and Q to close this
window and go back to your workbook, now this will run every time you print
the workbook. If you are using excel 2000 or newer you may have to change
the macro security settings to get the macro to run. To change the security
settings go to tools, macro, security, security level and set it to medium


For other ways to do this or if this is going to be used in a temple have a
look here

http://www.mcgimpsey.com/excel/udfs/sequentialnums.html




--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003


"Roger" wrote in message
...
strange request he

I have a sheet that is numbered in a cell and I was wondering if there is
anyway to advance that number by 1 whenever the sheet is printed (best
solution).
OR
any other suggestion would be great. These are forms that I need to
identify individually and I'm being lazy about having to remember to
change
the number identifier each time

Thanks in advance




Roger

auto number roll over?
 
that worked, many thanks!

"Paul B" wrote:

Roger, you could use some code like this in the before print event,

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Sheets("Sheet1").Range("A1").Value = _
Sheets("Sheet1").Range("A1").Value + 1
End Sub


To put in this macro, from your workbook right-click the workbook's icon and
pick View Code. This icon is at the top-left of the spreadsheet this will
open the VBA editor to the thisworkbook module, then, paste the code in the
window that opens on the right hand side, press Alt and Q to close this
window and go back to your workbook, now this will run every time you print
the workbook. If you are using excel 2000 or newer you may have to change
the macro security settings to get the macro to run. To change the security
settings go to tools, macro, security, security level and set it to medium


For other ways to do this or if this is going to be used in a temple have a
look here

http://www.mcgimpsey.com/excel/udfs/sequentialnums.html




--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003


"Roger" wrote in message
...
strange request he

I have a sheet that is numbered in a cell and I was wondering if there is
anyway to advance that number by 1 whenever the sheet is printed (best
solution).
OR
any other suggestion would be great. These are forms that I need to
identify individually and I'm being lazy about having to remember to
change
the number identifier each time

Thanks in advance





Paul B

auto number roll over?
 
Roger, your welcome
--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003

"Roger" wrote in message
...
that worked, many thanks!

"Paul B" wrote:

Roger, you could use some code like this in the before print event,

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Sheets("Sheet1").Range("A1").Value = _
Sheets("Sheet1").Range("A1").Value + 1
End Sub


To put in this macro, from your workbook right-click the workbook's icon
and
pick View Code. This icon is at the top-left of the spreadsheet this will
open the VBA editor to the thisworkbook module, then, paste the code in
the
window that opens on the right hand side, press Alt and Q to close this
window and go back to your workbook, now this will run every time you
print
the workbook. If you are using excel 2000 or newer you may have to
change
the macro security settings to get the macro to run. To change the
security
settings go to tools, macro, security, security level and set it to
medium


For other ways to do this or if this is going to be used in a temple have
a
look here

http://www.mcgimpsey.com/excel/udfs/sequentialnums.html




--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003


"Roger" wrote in message
...
strange request he

I have a sheet that is numbered in a cell and I was wondering if there
is
anyway to advance that number by 1 whenever the sheet is printed (best
solution).
OR
any other suggestion would be great. These are forms that I need to
identify individually and I'm being lazy about having to remember to
change
the number identifier each time

Thanks in advance








All times are GMT +1. The time now is 02:22 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com