Misc VBA Utilities


AutoVBA has several other tools that don't fit neatly into the previous categories:

  • Display Line Numbers
  • Sort code
  • Mass Import / Export Code Modules
  • Copy and Paste Userform Controls and Their Code

Display Line Numbers

What does it do?

vba display line numbers

Toggle displaying line numbers in the active module; useful when reviewing code.

How to access it?

Via the button on the Code Tools toolbar:

display line numbers toolbar

Sort Code

What does it do?

display line numbers toolbar

Allows you to quickly rearrange your code module without copying / pasting.

Simply open the Sort Code Menu, select code elements, and press the up/down arrow to move them.

How to access it?

Via the button on the Code Tools toolbar:

sort code toolbar

Mass Import / Export Modules

The Visual Basic Editor allows you to import or export modules and UserForms. Unfortunately, it only allows you to import or export one module at a time.

AutoVBA adds in the ability to mass import or export modules and UserForms. To access the features, right-click in the VBAProject window.

mass import export modules

Copy UserForm Controls and Code

The Visual Basic Editor allows you to copy / paste controls from one UserForm to another. Unfortunately, when you do this the associated control code isn't copy / pasted along with the control.

AutoVBA adds the ability to copy and paste the code along with the control. To access this feature, select your desired control(s) and select "Paste Special". Then go to the destination UserForm and choose Paste Special to paste the control(s) and the associated code.

copy paste userform control