sed doesn't modify the input file, it writes the result to stdout.
You must redirect the output of sed into a file :
sed -f insertcode newfile > new_newfile
If you just want to insert datas in an empty file don't use sed.
Code:
Variable="contents of Variable"
echo "First line;" > newfile
echo "Second line;" >> newfile
echo "Last line with $Variable" >> newfile
> newfile : reset newfile and redirect stdout to newfile
>> newfile : redirect stdout to newfile in append mode
another method:
Code:
Variable="contents of Variable"
cat <<EOD_CAT >newfile
First line;
Second line;
Last line with $Variable
EOD_CAT