
Makro getestet mit Excel 2003
Option Explicit
Private Declare Function SetCursorPos Lib „user32.dll“ ( _
ByVal x As Long, _
ByVal y As Long) As Long
Private Declare Sub Sleep Lib „kernel32.dll“ ( _
ByVal dwMilliseconds As Long)
Private Declare Function GetCursorPos Lib „user32.dll“ ( _
ByRef lpPoint As POINTAPI) As Long
Private Type POINTAPI
x As Long
y As Long
End Type
Private Sub Ausflug_MouseMove(ByVal Button As Integer, _
ByVal Shift As Integer, ByVal x As Single, ByVal y As Single)
x = Range(„A1“).Value
Range(„A1“).Value = x + 1
Dim myPos As POINTAPI
Dim Ziel_X As Long
Dim Ziel_Y As Long
Dim L As Long
Ziel_X = 225
Ziel_Y = 225
GetCursorPos myPos
If myPos.x >= Ziel_X Then
For L = myPos.x To Ziel_X Step -1
‚ sleep funktion zur zeitlichen steuerung empfindlichkeit hier
SetCursorPos L, myPos.y
Next
Else:
For L = Ziel_X To myPos.x
‚ sleep funktion zur zeitlichen steuerung empfindlichkeit hier
SetCursorPos L, myPos.y
Next
End If
If myPos.y >= Ziel_Y Then
For L = myPos.y To Ziel_Y Step -1
‚ sleep funktion zur zeitlichen steuerung empfindlichkeit hier
SetCursorPos Ziel_X, L
Next
Else:
For L = myPos.y To Ziel_Y
‚ sleep funktion zur zeitlichen steuerung empfindlichkeit hier
SetCursorPos Ziel_X, L
Next
End If
End Sub
Private Sub Einflug_MouseMove(ByVal Button As Integer, _
ByVal Shift As Integer, ByVal x As Single, ByVal y As Single)
x = Range(„A10“).Value
Range(„A10“).Value = x + 1
Dim myPos As POINTAPI
Dim Ziel_X As Long
Dim Ziel_Y As Long
Dim L As Long
Ziel_X = 225
Ziel_Y = 225
GetCursorPos myPos
If myPos.x >= Ziel_X Then
For L = myPos.x To Ziel_X Step -1
‚ sleep funktion zur zeitlichen steuerung empfindlichkeit hier
SetCursorPos L, myPos.y
Next
Else:
For L = Ziel_X To myPos.x
‚ sleep funktion zur zeitlichen steuerung empfindlichkeit hier
SetCursorPos L, myPos.y
Next
End If
If myPos.y >= Ziel_Y Then
For L = myPos.y To Ziel_Y Step -1
‚ sleep funktion zur zeitlichen steuerung empfindlichkeit hier
SetCursorPos Ziel_X, L
Next
Else:
For L = myPos.y To Ziel_Y
‚ sleep funktion zur zeitlichen steuerung empfindlichkeit hier
SetCursorPos Ziel_X, L
Next
End If
End Sub

