+ Reply to Thread
Results 1 to 2 of 2

Auto Generate NUmber

Hybrid View

Mooseman60 Auto Generate NUmber 10-03-2010, 09:38 AM
royUK Re: Auto Generate NUmber 10-03-2010, 10:52 AM
  1. #1
    Forum Contributor
    Join Date
    09-26-2010
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    182

    Auto Generate NUmber

    Hi

    Is it possible that each time I open the workbook it will generate a unique auto number.
    I will then save the spreadsheet under a different name so next time I open the original workbook it will generate the next consecutive number

    I hope this makes sense

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Auto Generate NUmber

    With a macro
    Option Explicit
    
    Private Sub Workbook_Open()
    Sheet1.Cells(1, 1).Value = Sheet1.Cells(1, 1).Value + 1
    End Sub
    Copy the Excel VBA code
    Select the workbook in which you want to use the code
    Hold the Alt key, and press the F11 key, to open the Visual Basic Editor
    In the Project Explorer, find your workbook, and open the list of Microsoft Excel Objects
    Right-click on the ThisWorkbook object, and choose View Code
    Where the cursor is flashing, choose Edit | Paste
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1