title: How do I reopen an Excel workbook while executing a VBA Macro it contains?
body: <p>I have done all sorts of things on my excel file and at the end I need to get back to the last saved version. So I close and reopen my excel file without saving, which works. Before closing the workbook I have copied a range of cells (created by using some sorting and filtering and stuff etc.) and now I need to paste them at the end of file when I reopen it.</p>
  
  <p>But when we re-open a workbook, the previously running macro does not continue where it stopped. I want to run the macro where it stopped when it reopens again. Is that possible?</p>
  
  <p>Well my idea is to put this code when the workbook opens:</p>
  
  <pre><code>     sub Auto_open()
       sheet1.activate
       ' and select the last row of the sheet1
       activesheet.paste
       end sub
  </code></pre>
  
  <p>because when the workbook reopens, it executes this subroutine automatically and copies the cells contents. But the drawback is we can't say its always cells will be under copied because if the user copies some data to the clipboard and then opens this file due to the Auto_open sub it copies that data to the end of sheet but that is not what I want. </p>
  
  <p>Can anyone suggest a good idea to get over this problem?</p>