Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formatting VBA Code

Status
Not open for further replies.

f64

Technical User
May 23, 2003
24
US
Is it possible to apply formatting (text color, boldface, underline, etc.) to VBA code itself? Beyond indenting and skipping rows, it would be helpful to be able to delineate blocks of code with some additional formatting. When printed on a color printer, even my green comments print black. If it's not possible to format code, is it possible to format just the comments?
 
I don't believe it is possible with the native VBA editor. When I want to accomplish this, I copy and paste the code into an editor that does natively support color highlighting and printing. In my case I am partial to GVIM.

[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
 
Hi f64,

VBA code formatting only applies to the VBE itself - not to printed or exported output.

There are tools which will print in colour. The only one I know about off the top of my head is Pretty Code Print (google for it) which I think works as an Office Add-In. I'm sure there are others.

Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.
Excel VBA Training and more Help at [url=http://www.vbaexpress.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top