Solved

How can I get an Excel spreadsheet to increase a number every time it is opened?

Posted on 2014-10-22
7
70 Views
Last Modified: 2014-10-22
I have an Excel spreadsheet.
I would like a specific field, ie a PO number, to increase by 1 every time the Excel spreadsheet is opened.
The date is not a problem to show for today's date, however to increase the specific field is.

How can this be done?
0
Comment
Question by:100questions
7 Comments
 
LVL 50

Expert Comment

by:Rgonzo1971
ID: 40396846
HI,

you could use an event macro (which is placed in the Workbook module(Alt+F11)

Private Sub Workbook_Open()
    Range("A1") = Range("A1") +1
End Sub

Regards
0
 
LVL 33

Expert Comment

by:Rob Henson
ID: 40396857
There is a VBA routine on WorkbookOpen that can be utilised. How knowledgeable on VBA are you?
0
 

Author Comment

by:100questions
ID: 40396879
Thanks, not very good.
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 50

Accepted Solution

by:
Rgonzo1971 earned 500 total points
ID: 40396903
See example

in the ThisWorkbook module (Alt+F11)

Regards
EE20141022.xlsm
0
 
LVL 26

Expert Comment

by:ProfessorJimJam
ID: 40396977
Do you mean like this?

if you PO number is in A2 then PO number is 00001559 and then next time you open it , it would be become 00001560

or you want another cell to be populated with 0001560 |?
0
 

Author Comment

by:100questions
ID: 40397928
@ProfessorjimJam - yes if the PO is 00001559 then the next time I open it, it needs to increase to 00001560.
0
 

Author Closing Comment

by:100questions
ID: 40397965
Works well, thank you.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This Article is a follow-up to my Mappit! Addin Article (http://www.experts-exchange.com/A_2613.html), it was inspired by an email posting I made to EUSPRIG (http://www.eusprig.org/index.htm), I will briefly cover: 1) An overvie…
Improved? Move/Copy Add-in Replacement - How to avoid the annoying, “A formula or sheet you want to move or copy contains the name XXX, which already exists on the destination worksheet.” David Miller (dlmille)  It was one of those days… I wa…
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question