Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 733
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default 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   Report Post  
Posted to microsoft.public.excel.programming
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.








  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to print line/row numbers as well ? Jeff Korn Excel Discussion (Misc queries) 4 February 28th 08 10:29 PM
Line and row numbers Scudo New Users to Excel 2 November 5th 05 09:01 PM
Line numbers some numbers are blue some are black nkt122866 Excel Discussion (Misc queries) 2 September 29th 05 09:32 PM
line and column numbers robhargreaves Excel Discussion (Misc queries) 1 August 2nd 05 03:08 PM
Line numbers H. Zhu Excel Programming 1 July 19th 03 11:21 PM


All times are GMT +1. The time now is 06:04 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"