Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Line numbers
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. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Line numbers
"Microsoft Forum" wrote...
Is it possible to view line numbers of a VBA subroutine on screen and in printing? Thanks a lot. Not in Office's Visual Basic Editor. If you want to have positional indicators in code that you can find in the Visual Basic Editor, then you'd need to add comments to your code that provide such. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Line numbers
Frederick,
Have a look at this add in http://www.mztools.com/ Regards Neil "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. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Line numbers
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. |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
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. |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Line numbers
Hi Tom,
worked fine and the msgbox line is not numbered. So it does. I was sure in previous testing unnumbered lines were ignored, as if they were commented. Normally I would have to put this down to loosing my senses, but in this case I'll blame it on a late night! FWIW another observation, line numbers do not need to be in any sort of order. regards, Peter "Tom Ogilvy" wrote in message ... 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. |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
Thanks for all your assistance! (No content)
"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. |
#8
Posted to microsoft.public.excel.programming
|
|||
|
|||
Line numbers
Hi Myrna,
Absolutely. It was something I thought I noticed for the first time just before posting, but not so as Tom pointed out. You may have misinterpreted my "So it does." as contradicting Tom, rather than conceding as was intended. Regards, Peter "Myrna Larson" wrote in message ... Not true. The only lines that VBA treats as comments are those that start with the REM command or an apostrophe. On Sun, 12 Dec 2004 15:22:08 -0000, "Peter T" <peter_t@discussions wrote: I was sure in previous testing unnumbered lines were ignored, as if they were commented. Normally I would have to put this down to loosing my senses, but in this case I'll blame it on a late night! FWIW another observation, line numbers do not need to be in any sort of order. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to print line/row numbers as well ? | Excel Discussion (Misc queries) | |||
Line and row numbers | New Users to Excel | |||
Line numbers some numbers are blue some are black | Excel Discussion (Misc queries) | |||
line and column numbers | Excel Discussion (Misc queries) | |||
Line numbers | Excel Programming |