View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
That's Confidential That's Confidential is offline
external usenet poster
 
Posts: 4
Default Autorunning Macros

I have the following Macro set up in a workbook:-

Sub datechk()
Application.ScreenUpdating = False
For a = 1 To ActiveSheet.UsedRange.SpecialCells(xlLastCell).Row
If Cells(a, 4).Value < Date Then GoTo hit
Next a
MsgBox ("Accounts appear to be in order")
Application.ScreenUpdating = True
Exit Sub
hit:
MsgBox ("You have some accounts to be deleted!")

Application.ScreenUpdating = True
End Sub


To run this Macro, I have shortcuted it as Ctrl + Q.

Is there any way I can get this Macro to run automatically on opening the
workbook?