You can simply write your answer using what reported in the comment, and make it a Community Wiki; referring the user who wrote the comment is good practice too.
The reason of writing an answer is that an answer is more visible than a comment, especially when that comment is not the first given to that question, or it's not immediately understandable when that comment is correct. An answer can be up-voted, and if the OP is still around, accepted; that gives a clear signal to the future users of what is the solution for the question being asked.
If the comment is the answer, but it needs to consider what reported in previous comments, I would write the answer basing also on those comments.
When doing so, I would consider if the answer is really useful; if the answer is something on the lines of "Yes, you can." then it is not much that useful, and probably the question is not useful too (or too localized).