Hi,
What I am trying to do will take a bit of explaining. I have a random word generator that produces a new word every time F9 is pressed.
I am trying to make it so that F9 is automatically pressed at a user defined interval, but I can not get it to work.
My code is as follows:
Sub Test()
Set A = Sheet1.Range("G13")
Set Y = Sheet1.Range("G12")
Set X = (Now + TimeValue("0:00:Y"))
For Each i In A
If i = "Go" Then
Application.Wait X
SendKeys "F9"
End If
Next i
End Sub
Essentially my logic, planned action is as follows:
*Start the macro
*Cell G13 is the on off switch
*Cell G12 is the number of seconds delay that I want
* For each loop sends the F9 command ad given time interval.
I can't get this to work. If anyone can help it will be greatly appreciated.
Matt
What I am trying to do will take a bit of explaining. I have a random word generator that produces a new word every time F9 is pressed.
I am trying to make it so that F9 is automatically pressed at a user defined interval, but I can not get it to work.
My code is as follows:
Sub Test()
Set A = Sheet1.Range("G13")
Set Y = Sheet1.Range("G12")
Set X = (Now + TimeValue("0:00:Y"))
For Each i In A
If i = "Go" Then
Application.Wait X
SendKeys "F9"
End If
Next i
End Sub
Essentially my logic, planned action is as follows:
*Start the macro
*Cell G13 is the on off switch
*Cell G12 is the number of seconds delay that I want
* For each loop sends the F9 command ad given time interval.
I can't get this to work. If anyone can help it will be greatly appreciated.
Matt