Coloring / highlighting code
Is there some way I can color certain parts of VBA code?
I'm supposed to fold two sets of code changes into one unified code base. While I'm doing this (and the inevitable debugging afterwards), I'd like to identify which prototype a particular piece of code came from.
I could use comments, e.g.
' This came from prototype 1
blah blah blah
blah blah blah
blah blah blah
' This came from prototype 2
blah blah blah
blah blah blah
' This came from prototype 1
blah blah blah
But it would be nicer if I could change the code color, say, green for prototype 1 and blue for prototype 2.
Is this sort of thing possible with VBA?
Thanks!
Re: Coloring / highlighting code
Select the text you want to color.
In the editor, you can go to Tool > Options > Editor Format (TAB).
Then click 'Selection' from the left list box, then choose the foreground color you want the text to be.
Should be what you need.
Hope this helps.
Re: Coloring / highlighting code
Quote:
Originally Posted by dbrother
Select the text you want to color.
In the editor, you can go to Tool > Options > Editor Format (TAB).
Then click 'Selection' from the left list box, then choose the foreground color you want the text to be.
Should be what you need.
Hope this helps.
The only hitch is that the moment you "comment" the colored piece of code, it will change back to green...
Re: Coloring / highlighting code
Hmm.. seems like you're correct. I wouldn't advise any custom 'color-coding' of you own in case someone in the furture needs to support your application.
The color-coding may make sense to you, but might throw a newbie or other off becuase of the different format.
Re: Coloring / highlighting code
It's my own code. Nobody will be supporting if they are not me. I think I can handle it. ;-)
That's too bad. It's a powerful IDE that I've grown to love, but there are certain things I really would like to tweak. I'd kill to have vim style keybindings or a more powerful/more convenient bookmarking system.