+ Reply to Thread
Results 1 to 2 of 2

Macro to Generate Complex Number/Code

  1. #1
    Forum Contributor
    Join Date
    01-21-2013
    Location
    Aberdeen, Scotland
    MS-Off Ver
    Excel 2007
    Posts
    258

    Macro to Generate Complex Number/Code

    Hello All,

    does anyone have any ideas how to write a Macro that will generate complex numbers/code?

    What I'd like is a number like this "ENER-TR-0213-001" Where the 'ENER-TR' is static, the '0213' is the month and the year and the '001' is just a simple number that will increase with every number I generate.

    When generated the number will be temporarily stored in cell (R, 12) and then later shifted to another worksheet (with other data) where I store all the numbers generated in column (A, 2 - onwards)

    So this macro would have something to clear the contents of the cell, generate a unique number in sequence (in the above format) and store it in Cell R12 every time I run the Macro.

    The numbers can never be duplicates.

    Many Thanks for any help in advance, always greatly appreciate the amount of help I get from this forum.

  2. #2
    Forum Expert Jakobshavn's Avatar
    Join Date
    08-17-2012
    Location
    Lakehurst, NJ, USA
    MS-Off Ver
    Excel 2007
    Posts
    1,970

    Re: Macro to Generate Complex Number/Code

    Give this macro a try:

    Please Login or Register  to view this content.
    It updates R12 by both the date and an increased serial number. Clearly, you must leave R12 alone after you copy it elsewhere.
    Gary's Student

+ 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