Gruppe
VBE
Problem
Wie kann ich die exakte, aktuelle Cursorposition in der Entwicklungsumgebung auslesen?
ClassModule: Tabelle1
Private Sub CommandButton1_Click()
Dim lRow As Long, lColumn As Long
On Error GoTo ERRORHANDLER
Application.VBE.ActiveCodePane _
.GetSelection lRow, lColumn, 0, 0
MsgBox "Zeile: " & lRow & vbLf & _
"Spalte: " & lColumn, _
vbInformation, _
"Cursorposition in der Entwicklungsumgebung"
Exit Sub
ERRORHANDLER:
MsgBox "Kein Cursor in der Entwicklungsumgebung!"
End Sub