PDA

View Full Version : Line numbering in the VBE



clvestin
04-02-2007, 05:27 PM
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??

stanleydgrom
04-02-2007, 06:45 PM
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

johnske
04-02-2007, 07:41 PM
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,
StanThat option's not available in Office 2K...

MZ tools has an add-in with an option to add or remove line numbers :)

Bob Phillips
04-03-2007, 12:39 AM
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.

Bob Phillips
04-03-2007, 12:40 AM
It is on the far right of the toolbar.

johnske
04-03-2007, 01:04 AM
My apologies, it is there as xld says (shows how often I use it :))

Bob Phillips
04-03-2007, 01:55 AM
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 :rotlaugh:

Marcster
04-03-2007, 10:52 AM
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:

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


Marcster.