adding comments to code

graemeal

Active Member
Joined
May 17, 2007
Messages
316
Platform
  1. Windows
How do you add a comment within a code on a post which turns it into blue text. Such as the '-- or whatever range you want.

Thanks

Code:
If CheckedRange Is Nothing Then
        Set CheckedRange = Me.Range("A1:A2") '-- or whatever range you want
        CellsCount = CheckedRange.Cells.Count
        ReDim OldValue(1 To CellsCount)
        For i = 1 To CellsCount
            OldValue(i) = CheckedRange(i)
        Next
    End If
End Sub

XP XL2007
 
You mean when posting code to the board? If so - wrong forum, which makes this difficult to understand.. But if that is the question, then the answer is: http://www.mrexcel.com/vbaddin.shtml

If it's *not* what you mean.. can you try explaining again?
 
Yes that is what I was after. Thank you very much. Still working my way around the do's and dont's of the site.

Thanks
 
No biggee - I moved it where it may be more helpful. But the forum can affect the context of your post :)
 
You can also just colour it manually within the code tags.
Rich (BB code):
If CheckedRange Is Nothing Then
    Set CheckedRange = Me.Range("A1:A2") '-- or whatever range you want
    CellsCount = CheckedRange.Cells.Count
    ReDim OldValue(1 To CellsCount)
    For i = 1 To CellsCount
        OldValue(i) = CheckedRange(i)
    Next
End If
 
Thanks Peter but excuse my ignorance. How is that done? It was the first thing I looked for.
 
Thanks Peter but excuse my ignorance. How is that done? It was the first thing I looked for.
Click the 'Quote' button at the bottom of my previous post and you will see the code tags that apply the blue colour.

When using the Quick Reply window you should see some formatting options including font colour just above that window - unless in your User CP|Edit Options|Message Editor Interface you have it set to Basic Editor. (I normally have mine set to Standard Editor)
 
Personally, I'm a big fan of the VBHTML Maker. PM me your e-mail address and I'll send you a copy.
 
Personally, I'm a big fan of the VBHTML Maker. PM me your e-mail address and I'll send you a copy.
Me too, and that is what I normally use. It can also be downloaded directly from the link in Tracy's post (#2) above.

However, sometimes I like to use this manual method to highlight a change to some previously posted code.
 

Forum statistics

Threads
1,221,572
Messages
6,160,575
Members
451,656
Latest member
SBulinski1975

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top