Link to home
Start Free TrialLog in
Avatar of E=mc2
E=mc2Flag for Canada

asked on

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

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?
Avatar of Rgonzo1971
Rgonzo1971

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
There is a VBA routine on WorkbookOpen that can be utilised. How knowledgeable on VBA are you?
Avatar of E=mc2

ASKER

Thanks, not very good.
ASKER CERTIFIED SOLUTION
Avatar of Rgonzo1971
Rgonzo1971

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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 |?
Avatar of E=mc2

ASKER

@ProfessorjimJam - yes if the PO is 00001559 then the next time I open it, it needs to increase to 00001560.
Avatar of E=mc2

ASKER

Works well, thank you.