在Office的VBA编辑器(ALT + F11)中,如何注释或取消注释代码块?
当前回答
或者只是点击查看,工具栏,编辑。然后,您可以选择一段代码,然后单击“注释”或“取消注释”工具栏按钮,一键完成所有操作。
另外,你也可以用Tab/Shift+Tab键对选定的文本块进行标记。当我还是个新手的时候,我很长一段时间都不知道,每次都是一行一行地做。
好运!
其他回答
添加按钮到注释或取消注释代码块的简单方法是:
进入视图-工具栏-自定义 选择Command选项卡 选择左边的Edit Category 拖动“评论块”和“取消评论块”图标到工具栏上。
或者只是点击查看,工具栏,编辑。然后,您可以选择一段代码,然后单击“注释”或“取消注释”工具栏按钮,一键完成所有操作。
另外,你也可以用Tab/Shift+Tab键对选定的文本块进行标记。当我还是个新手的时候,我很长一段时间都不知道,每次都是一行一行地做。
好运!
Right-click on the toolbar and select Customize... Select the Commands tab. Under Categories click on Edit, then select Comment Block in the Commands listbox. Drag the Comment Block entry onto the Menu Bar (yep! the menu bar) Note: You should now see a new icon on the menu bar. Make sure that the new icon is highlighted (it will have a black square around it) then click Modify Selection button on the Customize dialog box. An interesting menu will popup. Under name, add an ampersand (&) to the beginning of the entry. So now instead of "Comment Block" it should read &Comment Block. Press Enter to save the change. Click on Modify Selection again and select Image and Text. Dismiss the Customize dialog box. Highlight any block of code and press Alt-C. Voila. Do the same thing for the Uncomment Block or any other commands that you find yourself using often.
将图标添加到工具栏后,在修改所选图标时,名称输入中的&号指定下一个字符是与Alt一起用于快捷方式的字符。因为你必须从Modify Selection下拉菜单中选择一个显示选项,包括显示文本,你也可以在name字段中写入&C,得到与&Comment Block相同的结果(没有冗长的文本)。
你查过MZTools了吗??它能做很多很酷的事情…
如果我没说错的话,它提供的功能之一是设置你自己的快捷方式。