Julian, welcome to the board, here is a short Marco that will pop up a message box at 6:00 PM
Private Sub Workbook_Open()
'Run YourSub at 6pm
Application.OnTime TimeValue("18:00:00"), "YourSub"
Then in a normal module you'd have YourSub...
'incase the workbook is not closed, will set the timer for the next day
Application.OnTime TimeSerial(18,0,0), "YourSub"
To put in this code, press alt and F11 to open the VBA editor, in the left hand window double click on thisworkbook, under your workbook name, and paste the workbok open code in the window that opens on the right hand side, then go to insert, module, and paste the code for "your sub" in the window that opens on the right hand side now this will run every time you open the workbook
ON TIME is XL's timing mechanism - you will need to ensure your file is open for this to work.
A windows scheduler will launch XL for you and open a specific file (ie. you don't need to keep it open) - if the file then has a workbook_open event in it, then it can do whatever it is you want done (run another macro or whatever). You will need to ensuer your application.displayalerts = false and then macro security is set to low.
didn't mean to sound like i was exploiting your help, it's just that i'm really new to this vba thing. in fact i've hardly used it. have no programming experience or training at all so all the syntax is essentially alien to me.
i need to harvest data from a reuters item that unfortunately doesn't have a time series so i need to build one.
i've searched quite a few websites but the closest i've got was running a macro on launching xl/wkbk.
i will be keeping the spreadsheet open so i thing ontime will be suitable. will try out the suggestions.
Julian, the Private Sub Workbook_Open() part needs to be put in the thisworkbook module if that is where you put it it should work, you will have to save and close and then open the workbook for it to run, here are instructions if I was not clear on it
To put in this code, press alt and F11 to open the VBA editor, in the left hand window double click on thisworkbook, under your workbook name, and paste the code in the window that opens on the right hand side, now this will run every time you open the workbook
Julian, I have never tried to run two Marcos at the same time, I am not sure that will work, which one would try to run first? I think I would run the first one and then the second on a minute latter, or call the second sub from the first one like this
'First code here
'Name of the second code here