View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default get the line at cursor number in the module

Tom,

Use code like

Dim StartLine As Long
Dim EndLine As Long
Dim StartCol As Long
Dim EndCol As Long

Application.VBE.ActiveCodePane.GetSelection _
StartLine, StartCol, EndLine, EndCol


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"tom taol" wrote in message
...


in excel programing, i want to get current line number which be
cursor
in VBE.

MsgBox Application.VBE.ActiveCodePane.CodeModule.CountOfL ines

this is not. i don't know.

*** Sent via Developersdex http://www.developersdex.com ***