+ Reply to Thread
Results 1 to 3 of 3

Running counter each time a function is executed (VBA)

  1. #1
    Registered User
    Join Date
    04-23-2017
    Location
    Boulder, Colorado
    MS-Off Ver
    Excel
    Posts
    2

    Running counter each time a function is executed (VBA)

    I am struggling slightly with my indexing of my array. I want the upper bound of the array to be the amount of time's the Function RandomizeDice() executes. Any help is greatly appreciated.

    Please Login or Register  to view this content.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,425

    Re: Running counter each time a function is executed (VBA)

    As far as I can see, the index i is declared in both subroutines and i is not incremented in the RollDice routine. If you want both routines to use i, then either make it public or pass it as a parameter.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Running counter each time a function is executed (VBA)

    Not sure what your objective is.

    This will roll the dice pair 10 times and put the results in three arrays.

    Please Login or Register  to view this content.
    Last edited by AlphaFrog; 04-23-2017 at 03:36 PM.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

+ 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. Replies: 0
    Last Post: 10-05-2016, 10:26 AM
  2. [Contribution]Time counter/Clock
    By joejiang2001 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-07-2015, 04:50 PM
  3. time/counter format
    By Micbrook in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 02-19-2015, 06:08 PM
  4. Resetting running counter based on conditions being satisfied
    By Stdnt in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-17-2014, 06:15 PM
  5. Time Counter!
    By zks in forum Excel General
    Replies: 2
    Last Post: 01-20-2012, 01:33 PM
  6. Running counter using time
    By cdrum84 in forum Excel General
    Replies: 1
    Last Post: 06-06-2010, 11:47 AM
  7. Running counter
    By GeorgeBob in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-13-2009, 11:20 PM

Tags for this Thread

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