I have been testing several solutions for posting formatted code to these forums and blogs. There are a few that I can build-in, but I am nervous messing with the code base as we are just getting going.
The code below is formatted using Windows Live Writer, a free blogging tool
from here. I have added to that an add-in, (there are dozens of them) to
insert code snippets. (There are lots of these too).
You can just add this as a plug-in very simply and it appears as a link in the right sidebar of WLW. Click on it, paste your VBA code (or other code if you need) and, in VBA's case select VB as the language.
You can either set it to be in a container or post the styles with the post.
Now the tricks. If you are posting to a blog (even one on
www.excelusergroup.org), then you can very easily link to your account there and just post at the click of a button...job done.
If you want the formatted code in a forum post, just go to View>HTML Code and copy the post in it's entirety. Now take this HTML to the forum and either start a new post or reply to an existing one and click on the HTML button in the editor and paste the code.
Job done, (an example is below, posted in it's 'container', formatted, indented the lot and you can even add line numbers to make navigation or instructions for readers easier)
Hope you use it
Sub TestPost()
Dim wb As Workbook
Dim wks As Worksheet
Dim myCell As Range
'Assign Object Variables
Set wb = ThisWorkbook
Set wks = wb.ActiveSheet
'Iterate range
For Each myCell In wks.Range("A1:A100")
If myCell.Value = 1 Then
myCell.Value = "Do This"
End If
Next myCell
'Release object pointers
Set wks = Nothing
Set wb = Nothing
End Sub