Thread: Line numbers
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Line numbers

Sub test()
1 Dim v
10 v = 2
20 If v = 4 Then
MsgBox "Bye"
40 Exit Sub
50 End If
60 v = 4
70 GoTo 20
End Sub

worked fine and the msgbox line is not numbered.

--
Regards,
Tom Ogilvy

"Peter T" <peter_t@discussions wrote in message
...
Hi Frederick,

Sub test()
1 Dim v
10 v = 2
20 If v = 4 Then
30 MsgBox "Bye"
40 Exit Sub
50 End If
60 v = 4
70 GoTo 20
End Sub

Try pasting old code without numbers to Col B on your worksheet, put
appropriate numbers in Col A, paste all back to the vbe.

Seems if you number some lines, any lines that are not numbered are

ignored,
including Dim statements.

Regards,
Peter

"Microsoft Forum" wrote in message
...
Hi all,

Is it possible to view line numbers of a VBA subroutine on screen and in
printing? Thanks a lot.

Frederick Chow
Hong Kong.