+ Reply to Thread
Results 1 to 8 of 8

Macro that runs at a certain time based on time in a cell

  1. #1
    Valued Forum Contributor
    Join Date
    03-03-2009
    Location
    UK
    MS-Off Ver
    MS365 Subscription Excel for Mac
    Posts
    1,017

    Macro that runs at a certain time based on time in a cell

    Firstly, I want to know if this is possible. If I have a cell that contains a date and another cell that contains a time can I run a macro that will go to an external website and import data 2 days before that date and time, 1 day before that date and time, 2 hours before the date/time etc etc.

    If this is possible, could anybody help me in getting the code for this?

    Thanks!

  2. #2
    Valued Forum Contributor
    Join Date
    03-03-2009
    Location
    UK
    MS-Off Ver
    MS365 Subscription Excel for Mac
    Posts
    1,017

    Re: Macro that runs at a certain time based on time in a cell

    Please Login or Register  to view this content.
    Would it be something like that?

  3. #3
    Forum Contributor
    Join Date
    08-01-2012
    Location
    Tampa
    MS-Off Ver
    Excel 2010
    Posts
    121

    Re: Macro that runs at a certain time based on time in a cell

    http://www.teachexcel.com/free-excel...day-excel.html

    Theres some further info. Test it and see what you get.

  4. #4
    Valued Forum Contributor
    Join Date
    03-03-2009
    Location
    UK
    MS-Off Ver
    MS365 Subscription Excel for Mac
    Posts
    1,017

    Re: Macro that runs at a certain time based on time in a cell

    Thanks for that link Jay. However that code will run everyday at a certain time whereas I just want it to run on a couple of specific days at a certain time if a cell in the workbook is within 2 days of the time. So if the cell I have has the date 3rd Jan 2013 then I want the macro to run at 1st Jan 2013.

  5. #5
    Valued Forum Contributor
    Join Date
    03-03-2009
    Location
    UK
    MS-Off Ver
    MS365 Subscription Excel for Mac
    Posts
    1,017

    Re: Macro that runs at a certain time based on time in a cell

    If I get code to run a macro on a specific date and time either, I could do a work around.

  6. #6
    Valued Forum Contributor
    Join Date
    03-03-2009
    Location
    UK
    MS-Off Ver
    MS365 Subscription Excel for Mac
    Posts
    1,017

    Re: Macro that runs at a certain time based on time in a cell

    Ok so I have this code at the minute

    Please Login or Register  to view this content.

    I have this code inserted into my Workbook. Cells A1 and A34 are dates in dd/mm/yyyy. A1 is today's date which I get using the TODAY formula. So I'm trying to say that if A34 - 3 equals todays date then call my Prices macro proivded that DONE isn't wrote in the cell on the Data sheet. However on testing nothing happens when the dates equal each other. Any idea where I'm going wrong?

  7. #7
    Valued Forum Contributor
    Join Date
    03-03-2009
    Location
    UK
    MS-Off Ver
    MS365 Subscription Excel for Mac
    Posts
    1,017

    Re: Macro that runs at a certain time based on time in a cell

    I should also add that inserting this code into the worksheet module doesn't work either.

  8. #8
    Valued Forum Contributor
    Join Date
    03-03-2009
    Location
    UK
    MS-Off Ver
    MS365 Subscription Excel for Mac
    Posts
    1,017

    Re: Macro that runs at a certain time based on time in a cell

    Please Login or Register  to view this content.
    I'm just trying to get the code to work by manually running it now in the worksheet module but it still doesn't work. In debugging it's highlighting the If Range entire line in yellow.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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