Unwanted Procedure & Do While

  • Thread starter Thread starter John Pierce
  • Start date Start date
J

John Pierce

I have two questions. One simple and one maybe not so simple.
First, how do I keep from getting a new "Private Sub UserForm_Click()"
procedure every time I select the code page for an existing user form?
Second. I have made a program to generate passwords which works
something like a slot machine in that it has a row of text boxes and
when it is run a series of randomly selected numbers and letters
flashes in each text box for a randomly selected length of time till
it settles on one and then moves on to the next box. Just for fun, I
added the feature of having a different wave file play while this is
happening in each text box. The thing is that the length of the wave
file and the randomly selected time that the characters are changing
is never the same. I would now like to make the character selection
take place for the exact amount of time as the wave file is playing.
 
You'll need to know the length of time each wave file plays for, then use
this type of logic. We'll assume that the length of time (in seconds) that
each wave file plays is in some variables named wave1Time, wave2Time, etc.:

start the music
aDelay = Timer
Do While Timer < aDelay+wave1Time
'put your code to put random #s into proper cell here
Loop

Repeat that for each cell/wave file in the series.
 
Back
Top