+ Reply to Thread
Results 1 to 3 of 3

Auto Number Generation

Hybrid View

abdul43 Auto Number Generation 09-10-2014, 10:05 AM
nathansav Re: Auto Number Generation 09-10-2014, 10:17 AM
abdul43 Re: Auto Number Generation 09-10-2014, 02:21 PM
  1. #1
    Registered User
    Join Date
    08-01-2011
    Location
    quetta
    MS-Off Ver
    Excel 2007
    Posts
    13

    Auto Number Generation

    HI,
    Is there any code by which i can get numbers in a specific cell increasing after every 2-3 seconds??? for example

    when i press start button inserted by control tool box
    in cell A1
    numbers start changing from
    1
    2
    3
    4
    5
    6
    till the last given limit.
    Help me if possible, please.

  2. #2
    Valued Forum Contributor
    Join Date
    09-21-2011
    Location
    Birmingham UK
    MS-Off Ver
    Excel 2003/7/10
    Posts
    2,188

    Re: Auto Number Generation

    Public sTime As Date
    
    Sub StartTimer()
    sTime = Now + TimeValue("00:00:02")
    Application.OnTime sTime, "Increment", , True
    End Sub
    
    Sub Increment()
    Range("a1").Value = Range("a1").Value + 1
    sTime = Now + TimeValue("00:00:02")
    Application.OnTime sTime, "Increment", , True
    End Sub
    Hope this helps

    Sometimes its best to start at the beginning and learn VBA & Excel.

    Please dont ask me to do your work for you, I learnt from Reading books, Recording, F1 and Google and like having all of this knowledge in my head for the next time i wish to do it, or wish to tweak it.
    Available for remote consultancy work PM me

  3. #3
    Registered User
    Join Date
    08-01-2011
    Location
    quetta
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: Auto Number Generation

    Thnks it worked with a tiny error that is

    by using this code when i want to insert a button the dialogue comes "Assign Macro" and there are two already which one to assign?
    and after assigning i click on button the dialogue comes:

    "Cannot run the macro 'Book1!increment'. the macro may not be available in this workbook or all macro may be disabled.


    bUT i have enabled the macro.
    Thanks in Adavnce
    Last edited by abdul43; 09-10-2014 at 02:48 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Auto invoice number generation?
    By alfgrey in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-02-2013, 08:38 PM
  2. Help with auto generation of worksheet
    By sdsliscool in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-19-2011, 05:34 AM
  3. Excel Cell auto generation
    By BMoxon in forum Excel General
    Replies: 2
    Last Post: 12-01-2009, 05:06 AM
  4. Auto Generation of values
    By jderik in forum Excel General
    Replies: 1
    Last Post: 06-26-2007, 04:12 AM
  5. [SOLVED] Add-in Auto-Generation
    By Adam in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-31-2005, 06:06 PM

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