2

Possible Duplicates:
How about newlines within comments?
Allow HTML tags in comments
How do comments work?
Comments don't have formatting tags or line breaks
Code in comment is all on one line
Can you put code snippets in comments?
Why can you type new lines in comments if they are never rendered?
How can I add new line in a comment?

I want to add multiline code to my Stack Overflow comments but Stack Overflow parses everything to one line. I tried the two spaces

below is the code

 Set objApp = CreateObject("Excel.Application")
 objApp.Visible = True
 Set wb = objApp.Workbooks.Open("template.xls", True, False)
 wb.Sheets(1).Rows(3).Delete
 wb.Sheets(1).Range("A1").Value = title
 objApp.Cells.Select
 objApp.Selection.Borders(xlDiagonalDown).LineStyle = xlNone
 objApp.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
 With objApp.Selection.Borders(xlEdgeLeft)
 .LineStyle = xlContinuous
 .ColorIndex = 0
 .TintAndShade = 0
 .Weight = xlThin
 End With
1
  • No. And I think you should lurk 'round here for a bit. Posting meta questions on SO is a common mistake for NKOTB. Commented Aug 23, 2011 at 18:58

3 Answers 3

7

If you are wanting to add code into a comment then you are doing it wrong.

You should be either editing it into your question/answer or posting it as an answer.

Comments are designed for someone to ask the post owner for clarification. The post owner should then update their post with the requested information. You could then reply to the comment saying you've made the update just to make sure they see it.

answered Aug 23, 2011 at 18:33
2

Not possible. Comments are all one lines only.

answered Aug 23, 2011 at 15:29
0
1

You will have to use Pastebin or put it in a question edit or answer. You cannot have multi-line code in a comment.

answered Aug 23, 2011 at 18:34

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.