+ Reply to Thread
Results 1 to 7 of 7

“Stamping” an auto generated reference number

  1. #1
    Registered User
    Join Date
    04-22-2009
    Location
    Liverpool, England
    MS-Off Ver
    Excel 2007
    Posts
    32

    Thumbs up “Stamping” an auto generated reference number

    Is there a way to auto generate a unique number that will stay with the adjacent data record? My problem at the moment is when a record is deleted or the data sorted the ref number changes. I am using Excel 2008
    Also, can someone direct me to an online glossary of terms, functions and syntax for VBA please?
    Thanks in anticipation
    Attached Files Attached Files
    Last edited by Fairport; 04-28-2009 at 07:49 PM.

  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: “Stamping” an auto generated reference number

    Change your existing code to
    Please Login or Register  to view this content.
    Hope that helps.

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

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    04-22-2009
    Location
    Liverpool, England
    MS-Off Ver
    Excel 2007
    Posts
    32

    Re: “Stamping” an auto generated reference number

    Thanks, it works up to a point, but having cut and pasted your code into my working spreadsheet the numbers start at 92 and I cant find a way to reset it to 1. Any reason for that?

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

    Re: “Stamping” an auto generated reference number

    Have you got existing numbers there?

  5. #5
    Registered User
    Join Date
    04-22-2009
    Location
    Liverpool, England
    MS-Off Ver
    Excel 2007
    Posts
    32

    Re: “Stamping” an auto generated reference number

    No. The spreadsheet had no data in whatsoever apart from headings. I have attached a blank example.
    Attached Files Attached Files

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

    Re: “Stamping” an auto generated reference number

    There must have been some data somewhere in Column A, because when I cleARED THE COLUMN THE NUMBER WORKED. i HAVE ALSO AMENDED THE CODE SLIGHTLY
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    04-22-2009
    Location
    Liverpool, England
    MS-Off Ver
    Excel 2007
    Posts
    32

    Thumbs up Re: “Stamping” an auto generated reference number

    Thanks royUk, that seems to have solved the problem. I will check column A in the original spreadsheet. Thanks also for the modified code.

+ 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