See the tutorial: http://www.avast.com/files/tutorials/insert_key.htm
Please take a look here: http://www.avast.com/eng/i_was_successfully_r.html

What is the error message?
Is your system date/time correct?
Do you use copy & paste method?
Like Oldman said, are you sure you do not include the ‘last blank space’ in the paragraph while copying & pasting?
Which avast version are you trying to register (Home or Professional)?