How is it that everyone else gets the nice formatted code in their posts?

I do a cut-and-past from either MCS or NOTEPAD and my postings are virtually unreadable. The formatting is all messed up, and there are lots of extra spaces, etc.

I swear that the code I write doesn't look so bad to me, but when I post it on the forum, it is a mess.

What should I do?