added functionality to write to excelsheet, select the correcly sized range