Thread: AutoRun Macro
View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Don Guillett Don Guillett is offline
external usenet poster
 
Posts: 10,124
Default AutoRun Macro


Glad you got it together
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"chrisnsmith" wrote in message
...
As I said before, I'm new at this so it took me awhile to realized your
code
would only run on the initial opening of my workbook. I inserted it in a
module and it worked great. Thanks.

"Don Guillett" wrote:

This should do it. Now you need to tell us when you want it to fire. If
you
want it to fire when the file opened put in the ThisWorkbook module
Auto_Open. But that would assume the changes had been made. Perhaps you
want
to put in the Before_close.

Sub runifdatechg()
If Range("c1") < Date Then
Range("H9:I31").Copy Range("D9:E31")
Range("F9:I31").ClearContents
Range("c1") = Date
End If
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"chrisnsmith" wrote in message
...
I have the following macro for my spreadsheet along with one cell
designated
for the Taday() function. How do I set this macro to autorun when the
date
changes?

Sub CustomerFutures()
'
' CustomerFutures Macro
'
'
Range("H9:I31").Select
Selection.Copy
Range("D9:E31").Select
ActiveSheet.Paste
Range("F9:I31").Select
Application.CutCopyMode = False
Selection.ClearContents
End Sub