In a saucepan over medium heat, combine sugar, milk, and margarine. Bring to a boil, stirring occasionally, then boil for 4 to 5 minutes. Remove from heat and stir in the oats, vanilla, cocoa and coconut. Spoon onto waxed paper and allow to cool in the fridge. Store in an airtight container.