If you don't know how to write the value in a variable into an Excel sheet you'd better start your first VBA course before proceeding with this code.