Look at the HTML, and it should be fairly clear which part of the code is for the ad. Usually the code you actually want is followed by something like
[a href="URL where I got this code"] Get your code here too!!! [/a].
Get rid of all of that and the ad should vanish without screwing up your cursor. I can't tell you exactly what to remove without seeing the code, but I'm hoping that when you take a look at it, it's obvious. Make a copy first just in case, so if the worst happens you can replace it, ad and all.