View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Bill Martin[_2_] Bill Martin[_2_] is offline
external usenet poster
 
Posts: 105
Default How do you run macro automatically each time workbook is saved?

Husker87 wrote:
I have a macro that copies some data to another worksheet in the workbook.
It copies the data as values only. (Some of the date in the first worksheet
is result of formulas and I just want the data to be copied) Anyway, how can
I run the macro each time the workbook is saved so that the second worksheet
always has update data in it? Any ideas?


-------------------

You need to write an event driven macro which will call the other routine that
does your actual work. Look in Walkenbach's VBA book, pg 616 for the
"BeforeSave" event and a code example that just a few lines long. I'd reproduce
it here for you, but it's obviously copyrighted.

Bill