Consulting

Results 1 to 8 of 8

Thread: Line numbering in the VBE

  1. #1
    VBAX Regular
    Joined
    Jul 2005
    Posts
    74
    Location

    Line numbering in the VBE

    The title says it all. On occasion I have to work with people remotely, and guiding them to a particular sequence or line can be a pain.
    Anyone aware of a good method, add-in, etc for doing something like this??

  2. #2
    VBAX Tutor
    Joined
    Nov 2006
    Location
    North East Pennsylvania, USA
    Posts
    203
    Location

    Help with line numbering

    If you go into the VB editor,
    right click on the toolbar, just below the menu bar.

    Click on 'Customize', put a checkmark in 'Standard', click on close.

    You will see 'Ln #, Col #.

    Hope this helps.

    Have a great day,
    Stan

  3. #3
    Administrator
    Chat VP
    VBAX Guru johnske's Avatar
    Joined
    Jul 2004
    Location
    Townsville, Australia
    Posts
    2,872
    Location
    Quote Originally Posted by stanleydgrom
    If you go into the VB editor,
    right click on the toolbar, just below the menu bar.

    Click on 'Customize', put a checkmark in 'Standard', click on close.

    You will see 'Ln #, Col #.

    Hope this helps.

    Have a great day,
    Stan
    That option's not available in Office 2K...

    MZ tools has an add-in with an option to add or remove line numbers
    You know you're really in trouble when the light at the end of the tunnel turns out to be the headlight of a train hurtling towards you

    The major part of getting the right answer lies in asking the right question...


    Made your code more readable, use VBA tags (this automatically inserts [vba] at the start of your code, and [/vba ] at the end of your code) | Help those helping you by marking your thread solved when it is.

  4. #4
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Quote Originally Posted by johnske
    That option's not available in Office 2K...
    Yes it is, it is a label telling you where the curosr is located and should be sufficient for somone feeding back.

  5. #5
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    It is on the far right of the toolbar.

  6. #6
    Administrator
    Chat VP VBAX Guru johnske's Avatar
    Joined
    Jul 2004
    Location
    Townsville, Australia
    Posts
    2,872
    Location
    My apologies, it is there as xld says (shows how often I use it )
    You know you're really in trouble when the light at the end of the tunnel turns out to be the headlight of a train hurtling towards you

    The major part of getting the right answer lies in asking the right question...


    Made your code more readable, use VBA tags (this automatically inserts [vba] at the start of your code, and [/vba ] at the end of your code) | Help those helping you by marking your thread solved when it is.

  7. #7
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    I didn't know either until I checked what the guy said. I bet the coder didn't get a very big bonus for that facility

  8. #8
    VBAX Mentor Marcster's Avatar
    Joined
    Jun 2005
    Posts
    434
    Location
    Not really what your after, but I thought I'ld post this anyway...

    There is an undocumented feature of VBA called Erl.
    It's hidden in the Information Class of VBA.
    To see it you need to Show Hidden Members, right-click in the Object Browser.

    To use it:
    [VBA]
    Sub ErrorLineTest()
    On Error GoTo ErrorLineTest_Error
    1 MsgBox "This is messagebox.", vbInformation, "Title 1"
    2 MsgBox "This is the error line.", , vbCritical, "Title2"
    Exit_Here:
    Exit Sub
    ErrorLineText_Error:
    Dim errorLineNumber As Integer
    errorLineNumber = Erl
    MsgBox "Error on line: " & errorLineNumber, vbCritical, "ERROR"
    Resume Exit_Here
    End Sub
    [/VBA]

    Marcster.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •