Share via

Automatic numbering not working

Anonymous
2018-08-16T16:28:13+00:00

I have an Excel 2010 workbook that every timed I open it, it automatically numbers itself - this has stopped working.

In cell K3, the number is 4881, so the next time I open the file I would like the number to be 4882, (the way it used to be)

Here is the code I am using:

Private Sub Workbook_Open()

Sheets("ORDER").Range("K3").Value = Sheets("ORDER").Range("K3").Value + 1

End Sub

End Sub

Can you please help me to get it working again?

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

3 answers

Sort by: Most helpful
  1. Anonymous
    2018-08-20T13:51:09+00:00

    Hi Ossie.

    Can you let me know how I can get this working again?  Or start over?

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2018-08-17T12:51:20+00:00

    Thank you Ossie.

    It did come back True.  I do not have any other workbooks open...

    Was this answer helpful?

    0 comments No comments
  3. OssieMac 48,001 Reputation points Volunteer Moderator
    2018-08-17T02:04:19+00:00

    Some stuff to check.

    Open the VBA editor

    Open the Immediate window (Ctrl and G)

    Type the following command into the Immediate Window and press Enter and see if it returns True

      ? Application.EnableEvents

    If it returns False then perhaps you are using another workbook prior to opening the problem workbook and some code in it is disabling events and no code to re-enable events.

    If the above returns False then type the following into the Immediate window and press Enter and then save and close the workbook and re-open and see if the number is incremented.

    Application.EnableEvents = True

    Ensure that the problem workbook is saved prior to closing it otherwise the updated number is not saved.

    Holding the Shift key while opening the workbook stops the workbook open event from running.

    Was this answer helpful?

    0 comments No comments