Skip to content
| Marketplace
Sign in
Visual Studio Code>Formatters>VBA FormatterNew to Visual Studio Code? Get it now.
VBA Formatter

VBA Formatter

Antonio Turner

|
14,385 installs
| (1) | Free
Format Microsoft VBA and VBScript files.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

VBA Formatter

This is a VS Code extension to indent VBA and VBS files in the active text editor. As the title states, it's mainly for VBA files.

This is a fork/adaptation of VBSPretty by lenilsondc, Lenilson de Castro. You can check out the original here: https://www.npmjs.com/package/vbspretty

I made the following modifications:

  1. Adapted the .js to work insde of a VS Code extension.
  2. Adjust the new line from '\r\n' to '\n'. The former was always creating new lines under comments.
  3. Added logic to adapt to VBA files with headers. It will ignore the standard VBA headers and begin formatting the first line afterwards.

Features

Formats VBA and VBS files.

Requirements

VS Code v.1.85.0

Extension Settings

None

Known Issues

None at this time.

Release Notes

0.0.1

Iniital release

0.0.2

Added default line start at 0 when file does not have VBA headers

0.0.3

Added extension configuration Added extension as Document Format Provider. This allows the user to set the extension as the default formatter for the VB/VBS language.

Enjoy!

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft