Excel Help

15 pts.
Database Management Systems
Desktop management applications
Microsoft Systems Management Server
Programming Languages
Systems management software
Visual Basic
What I have now is a simple excel spreadsheet to input numbers and info. What I want to do with it is make it a template and have one cell in the top left corner to add a new number in order each time a new user opens it. For example in the cell would be number 123 and the next time when someone opens it, it would be 124. Is that possible? Thanks in advance.

Answer Wiki

Thanks. We'll let you know when a new response is added.

As far as I know you cannot implement a use counter in a template because when the user saves their data the template is not updated. This is as it should be otherwise mistaken input would alter the template for the next user in ways you never intended.

Discuss This Question: 5  Replies

There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • Ctg023
    That is what I figured, Thanks
    15 pointsBadges:
  • Darryn
    The easiest way to do this is to write a macro. Go to Tools-Macro-Visual Basic Editor This will open the VBA Editor. Hopefully you will have a project view in the left hand side of the screen and a blank page on the right. In the Project - VBAProject view, double click on your workbook name, and then double click on ThisWorkbook in the list. In the editor, write the code: '------------------------------------------------------ Private Sub Workbook_Open() Dim xNumber as integer 'Read in the current value xNumber = ThisWorkbook.Worksheets("NameOfWorksheet").Cells(1,1) 'Add 1 and put the new value in the worksheet ThisWorkbook.Worksheets("NameOfWorksheet").Cells(1,1).Value = xNumber + 1 'Make sure the change is saved ThisWorkbook.Save End Sub '------------------------------------------------------- You can pretty much copy and paste this code, the only change you need to make is to put the actual name of the worksheet in between the "NameOfWorksheet". Every line that starts with ' is a comment. Cheers
    765 pointsBadges:
  • LoudSinger
    I don't spend that much time in Excel macros, but I believe you could put some code in the Open event for the workbook. It might be that you would have to actually fire the incrementer code after the workbook has finished loading. Timing is key. Private Sub Workbook_Open() 'v = cell such and such value 'v++ end sub
    0 pointsBadges:
  • Jeffterry
    Another method would to use ODBC and VBA to increment a counter in a database (Access for instance). This way, the template would not have to be saved each time it was opened. Also, the template could be opened by multiple users simultaneously.
    0 pointsBadges:
  • Mcp111
    A good website for Excel help is www.mrexcel.com
    0 pointsBadges:

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.


Share this item with your network: