Skip to main content
3 of 5
added 12 characters in body
Taylor Raine
  • 8.7k
  • 2
  • 27
  • 51

Quick Note on Formatting

Because StackExchange uses Markdown and Prettify.js it is possible to add a language flag to your coding answers, which generally makes them look more professional. While I cannot guarantee that this will make you any better at golfing in VBA, I can guarantee that it will make you look like you are.

Adding either of the flags below will transform

Public Sub a(ByRef b As Integer) ''# this is a comment

to

Public Sub a(ByRef b As Integer) ''# this is a comment

Note: there seems to be a bit of an error with the way that Prettify.js handles VBA, in that it assumes the literal # (the character used to indicate conditional compilation) to be the comment character, rather than ', which is handled like a char literal character. Because of this, I recommend starting comments with ''# when using prettify.js as it looks correct both to the compiler and to prettify.js

VBA Language Tags

<!-- language: lang-vba -->

<!-- language-all: lang-vba -->

Note: the latter transforms all code segments in your answer, while the prior transforms only the immediately following code segments

Note, The Second: If you happen to be looking for VB or VBScript tips hear, you can use lang-vb or lang-vbs, respectively for highlighting

Taylor Raine
  • 8.7k
  • 2
  • 27
  • 51