#1
von d'r Bastler » 21. Mai 2024, 15:04
Moin allerseits,
folgender Spickzettel hilft z.B. per
BeforeDoubleClick die Position des Cursors in einem Sheet zu ermitteln.
Code: Alles auswählen
Option Explicit
Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Type POINTAPI
X_Pos As Long
Y_Pos As Long
End Type
Sub Get_Cursor_Pos()
Dim cPos As POINTAPI
GetCursorPos cPos
MsgBox "vertikal: " & cPos.Y_Pos & vbNewLine & "horizontal: " & cPos.X_Pos
End Sub
Der Code gehört in ein allgemeines Modul, der per Event im Worksheet aufgerufen wird.
Viel Spaß damit!
Moin allerseits,
folgender Spickzettel hilft z.B. per [i]BeforeDoubleClick [/i]die Position des Cursors in einem Sheet zu ermitteln.
[code]Option Explicit
Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Type POINTAPI
X_Pos As Long
Y_Pos As Long
End Type
Sub Get_Cursor_Pos()
Dim cPos As POINTAPI
GetCursorPos cPos
MsgBox "vertikal: " & cPos.Y_Pos & vbNewLine & "horizontal: " & cPos.X_Pos
End Sub[/code]
Der Code gehört in ein allgemeines Modul, der per Event im Worksheet aufgerufen wird.
Viel Spaß damit!