+ Reply to Thread
Results 1 to 2 of 2

Auto run a macro when a date/time has occured - any thoughts?

  1. #1
    Hotwheels42
    Guest

    Auto run a macro when a date/time has occured - any thoughts?

    Hi, I'm new to the board, I humbly ask for your acceptance... I work as a
    cost estimator and have developed a very, very nice program to calculate the
    selling price of our products. It incorporates Escalation, all direct labor
    rates and overhead rates, is capable of time shifting to forward dates and
    mid-points and so on. I have been "asked" by some of the people I answer to
    for copies of this program, but I hesitate. If not all the adjustments are
    kept up to date, the information can be eronious - and we all know "who will
    be to blame" for eronious information. Here is what I want to do. I want to
    have a macro that will delete all the pages then save the new file over top
    of the old file. And if they have another copy - again, upon opening it, and
    the statement seeing that the date has been passed - again activate the
    macro. - forcing them to come back to me for another - which would be the
    latest and greatest, right?
    any thoughts? - Cheers to you all - and thanks for being here.
    --
    HW42

  2. #2
    Hal
    Guest

    RE: Auto run a macro when a date/time has occured - any thoughts?

    Here's a place to start, and there may be better solutions. Place the code in
    a module. It will run each time the workbook is opened. If the exDate matches
    the computers system date a message box is displayed and the the workbook is
    closed.

    Hal

    Sub Auto_Open()
    Dim exDate As Date, curDate As Date
    exDate = DateSerial(2005, 10, 18)
    curDate = Date
    If curDate >= exDate Then
    MsgBox ("Get updated file from HW42!")
    ThisWorkbook.Close SaveChanges:=False
    End If
    End Sub


    "Hotwheels42" wrote:

    > Hi, I'm new to the board, I humbly ask for your acceptance... I work as a
    > cost estimator and have developed a very, very nice program to calculate the
    > selling price of our products. It incorporates Escalation, all direct labor
    > rates and overhead rates, is capable of time shifting to forward dates and
    > mid-points and so on. I have been "asked" by some of the people I answer to
    > for copies of this program, but I hesitate. If not all the adjustments are
    > kept up to date, the information can be eronious - and we all know "who will
    > be to blame" for eronious information. Here is what I want to do. I want to
    > have a macro that will delete all the pages then save the new file over top
    > of the old file. And if they have another copy - again, upon opening it, and
    > the statement seeing that the date has been passed - again activate the
    > macro. - forcing them to come back to me for another - which would be the
    > latest and greatest, right?
    > any thoughts? - Cheers to you all - and thanks for being here.
    > --
    > HW42


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1