How can I automatically populate the VBA Editor with line numbers?

前端 未结 7 1640
甜味超标
甜味超标 2020-12-02 01:41

I want to have line numbers in my VBA code for debugging reasons. That will allow me to know where a particular error occurred.

Is there an automatic feature for thi

7条回答
  •  [愿得一人]
    2020-12-02 02:00

    MZ-Tools for VBA has functions to add and remove line numbers to single functions, modules, or the whole project.

    See http://www.mztools.com/v8/onlinehelp/index.html?add_remove_line_numbers.htm

    Note 1: I find it better to configure the line number increment to 1 instead of 10. You will never manually add line numbers inbetween - whenever you edit the code, you first remove the line numbers, then add them back when you are finished.

    Note 2: Until a few years ago, there was a free version 3.0 of MZ-Tools, but it is surprisingly difficult to find a copy. But it is a good investment - there are lots of other useful features (e.g. the automatic adding of error handlers).

提交回复
热议问题