While playing around with Excel, I an trying to create a basic counter.
Each time the mouse moves over an ActiveX Label, I want to increase the number in a cell by one.
This seemed pretty straight forward however... When the event occurs, depending on the speed of the mouse, the number will increase by more than 1.
This is only a simple test for an idea I have and no other code after, just a simple counter on the MouseMove event.
Maybe someone can assist me figuring this out.
Thanks!
Each time the mouse moves over an ActiveX Label, I want to increase the number in a cell by one.
This seemed pretty straight forward however... When the event occurs, depending on the speed of the mouse, the number will increase by more than 1.
This is only a simple test for an idea I have and no other code after, just a simple counter on the MouseMove event.
Maybe someone can assist me figuring this out.
Thanks!
VBA Code:
Private Sub Label1_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
'MouseMove Test
Sheet10.Range("F16") = Range("F16").Value + 1 'Increment by one
If Sheet10.Range("F16").Value > 10 Then Sheet10.Range("F16").Value = "0" 'When counter reaches 10 reset to 0.
End Sub