Scheduling Ontime
Feb 15, 2007
Is there a way to set the ontime application to run even when excel is turned off? I'd like to be able to refresh a data table every morning at 6:30, even if excel is not on. Ideally, if even my computer isn't on. The code below works, but only if the sheet is open to the exact worksheet.
Option Explicit
Public RunWhen As Double
Public Const cRunWhat = "The_Sub"
Sub StartTimer()
RunWhen = TimeValue("09:54")
Application.OnTime earliesttime:=RunWhen, procedure:=cRunWhat, _
schedule:=True
End Sub
Sub The_Sub()
'my code here
StartTimer
End Sub
View 2 Replies
ADVERTISEMENT
Jan 16, 2009
Attached is the file wherein I am trying to make the scheduling gantt for UAE calendar where the weekends are Friday and Saturday. I am not able to format sundays as workdays some how through my conditions.
View 2 Replies
View Related
Nov 28, 2008
I have columns with the dates on the top, and staff listed on the rows to the left of the speadsheet. I must have 4 H's (indicating a base location), and 4 F's (indicating another base) in the column below the date. I want to have a cell, just above the date which will highlight red if there are any less than 4 H's and 4 F's. If there are 4 H's and 4 F's in the column (indicating full staffing levels), then I want the same cell to turn green, indicating that the day is OK. The red highlight would be a quick scan for supervisors to look at and see if we are deficient on staffing, and will prompt us to look for people who can be the missing H or F.
View 3 Replies
View Related
Feb 14, 2007
I have a table like the one below:
Day Night
2/26/2007DC
2/27/2007AB
2/28/2007AB
3/1/2007 CD
3/2/2007 CD
3/3/2007 BA
3/4/2007 BA
Each letter represents a 12 hour shift (ex. D team has 36 hours for the week). If I need coverage on 2/27/07 on the day shift, I need to find a team that is working 36 hours for that week and was not scheduled to work the shift before or the shift after. (Example, on 2/27/07 A team needs coverage. The only teams working 36 hours are D and C. C team work the previous shift. So the code would input D in a cell).
View 4 Replies
View Related
Sep 9, 2006
I have a simple macro that I run when I hit "Ctr Q".
How do I ensure that this macro runs every 5 minutes automatically from the first time I hit "Ctr-Q". Currently, it only runs once and then stops.
Here's my macro for your view:
Sub Macro1()
'
' Macro1 Macro
' Macro recorded 08-09-2006 by Scott
'
' Keyboard Shortcut: Ctrl+q
'
Range("B6").Select
ActiveCell.FormulaR1C1 = "NOW()"
Range("B6").Select
ActiveCell.FormulaR1C1 = "=NOW()"
Range("A4").Select
End Sub
View 9 Replies
View Related
Sep 26, 2006
I have a scheduling problem that I'm trying to get my head around. Im sure that some kind person can give me some ideas on how to get this started. It may be extremely easy, but I just cant get it off the ground. Basically I have 15 doctors that work for me - 9 full time (38hrs/week) and 6 part time (15+hrs/week) in a general practice. We are open 7 days a week
Open Close
Monday8:3019:00
Tuesday8:3019:00
Wed8:3019:00
Thur8:3021:00
Fri8:3019:00
Sat9:0018:00
Sun9:0018:00
Doctors have 5 days on and then 2 days off.
The below is the proposed daily schedule and the doctor requirements. % of booked patients for the times and % of random patients for the times are included as well as average waiting times.
Booked Random Waiting Doctors
8:30 - 10:00Morning Hours55%45%30min5-7
10:00 - 13:00Increasing80%20%45min7-8
13:00 - 18:00Busy 100%01.5hr8+
18:00 - 19:00Decreasing70%30%1hr6-7
19:00 - 21:00Night 40%60%30min5+
There are 3 types of patient visits
ShortDoubleTriple
%0.810.140.05
Minutes153045
58% of patients choose their doctor and 42% come in off the street and will take the first available doctor.
and finally - doctors cant work for more than 4 hours without a break. brek details are below
HoursBreak
<4hrs0
4 - 5hrs10min
5 - 8hrs2*10 mins - 45min lunch
8+2 * 10min 2*45min lunch
I need to create a timetable for the doctors which optimises their time based on the above details. I also need to design a data sheet for reception which will maximise the number of patients seen. Finally I need to calculate what the maximum number of patients the centre can see on an average day say monday.
View 9 Replies
View Related
May 16, 2014
If i input a 3 in a1 how do i return data in the 3 rows below:
Attached File : schedule2.xlsx
View 3 Replies
View Related
May 4, 2013
I'm trying to come up with an Employee Shift Scheduling template. I have 6 employees total with 3 different shifts (day, swing, graveyard). I would like to not do a rotating shift. I'm trying to figure out if a 5X8 shift is better or 4X10 and I would like to come up with a weekly schedule where I can see what shift everyone is working and were I have double coverage.
View 1 Replies
View Related
Jun 10, 2014
I have 20 staff members that I need to schedule in half day shifts (AM & PM) across three different locations for the month of July.
I want to make sure there is no overlap/duplication for any one staff in a time slot. Nor do I want any one staff member to work an AM and PM shift in the same day.
Ideally, I would also like to avoid back-to-back shifts (e.g., not allow PM on Monday to be scheduled for an AM on Tuesday).
Lastly, I would like to have the number of shifts be be as equitably distributed across all of the staff members as well.
Any way that I can do this in Excel?
View 1 Replies
View Related
Apr 13, 2006
I have a macro that I want to run on an hourly basis, say at 9am, 10am, etc whenever the workbook is open. This needs to be definable as I have several users that will be conducting the same activity throughout the day. In other words I want the macro to run on the hour for user 1, quarter past the hour for user 2, half past for user 3 and quarter to for user 4. Each user does have their own unique macro to run so it should (hopefully) just mean introducing a line of code to each, defining the time to run.
View 4 Replies
View Related
Oct 4, 2007
I have an excel spreadsheet that contains customer data exported from Quickbooks. In that file there is a column called CType (Column G) which contains the scheduling cycle for that customer. There are eleven different possible schedules, including 15xYr, 1xMo, 2xMo, EOM (every other month), EOW (every other week), EOW-S / 1xMo-W (every other week between 5/1 and 10/31 and once a month during the rest of the year), EOW-Th (every other week but must be on a Thursday), ETW (every third week), On Call, W, Q.
Although the number of records changes daily, on average there are about 950 rows of data in the spreadsheet.
I need to set up an array (?) for the values in column G starting with G2 through the last non-blank row (all records will have data in column G), and calculate the next scheduled service date based on the schedule type shown in column G and the last service date which will appear in column M of that row. The last thing I need to consider is whether there is a value in Column N, which would represent a hard-entered ‘Next Scheduled Service Date’. If I find a date in that column it needs to over-ride the calculated value. My assumption to this point is that I should use a new column T to hold the value of the calculated schedule date. There are a few other details, but rather than confuse this whole thing further I’ll stop there.
What I’m struggling with is the most efficient means of running this macro. I’ve been looking at many, many threads over the past few weeks, reading
VBA Programming for Dummies (which I apparently am), and reviewing other resources.
View 3 Replies
View Related
Apr 9, 2008
I am wanting to have a schedule posted as 8:00am to 5:00pm to show up in a format that shows the interval every thirty minutes with either a 1 or a zero so that I can calculate each intervals total staffing. Also if a break or lunch is entered I would like it to show a zero or .5 in the field (.5 being for 15 mins and 0 for anything taking the full 30 mins).
View 3 Replies
View Related
May 30, 2014
So I'm having a problem trying to make this scheduling sheet.. What I did was row a would be the employee list then b,c,d and so on are mon-sun Originally in b1 I would put like 9am-5pm and c1 8-4 and so on and in row i I put the total and added a sum function but somehow it wasn't able to calculate. So then I redid the whole thing this time in row b1 i put 9am and c1 5pm and so on and again I put the total and added the function and it still came out wrong..
View 2 Replies
View Related
Apr 22, 2006
I need to dispatch 10 technicians across the US starting each Monday. They go to 10 different customers for the whole week. I know the distance between each technician and each customer. What I would like to do is assign each technician to a customer so that the total distance traveled for all the technicians is minimized. I know that if it was only 3 techs and 3 customers (as an example), I could build a table of all the possible combinations (3 factorial or 6 permutations), determine the distance for each permutation and select the minimum. I'm not sure that doing this method with 10 techs is feasible as the number of permutations is 10 factorial or over 3 million possibilities. Anyone see a workable solution?
I've include a spreadsheet with customers, technicians and the distances between them!
View 9 Replies
View Related
Feb 14, 2007
I'm trying to create an Employee Scheduler. I want my employees (1 technician per row for a total of 10 rows) in the 1st column then the monthly calendar to the right (1 cell/day). That is what you'll see when you open the worksheet. Then, down below I set up my Data Area where I input my project, start date, end date, technician (where each tech is assigned a unique number), and other data across a row of cells. This could be infinite (or at least up to the very last row).
I modified a free Project Scheduler I got from XL-EasyGantt to become my Employee Scheduler but am having some difficulties getting it to do what I want. The project Scheduler basically works by entering (on the same row) the project (or task), the start date and finish date and then the cells get automatically filled in across those dates. This allows for overlapping of tasks but I want to create an Employee Scheduler so it doesn't allow overlapping or schedule a technician to start a new project before he/she has completed the one their on.
The main function which is in each cell of the monthly calendar is as follows: =IF(OR(AND($G28>=K$4,$G28<L$4),AND($M28>=K$4,K$4>=$G28)),IF(AND($E11="x",$M28>=K$4,$M28<L$4),"x",IF($E11=".",".","..")),"")
My problem: I want to be able to look at the Main Schedule and see when each Technician is scheduled for a job (or multiple jobs) for any given month. I want the function to look in my Data Area and assign the start date and end date of a project and the corresponding technician number and fill in the date cells across from their name in the Schedule above.
View 6 Replies
View Related
Oct 3, 2007
with opening a workbook at a specific time and/or running a macro at a specific time.
View 12 Replies
View Related
Aug 17, 2009
I am trying to get the following macro to run every half hour from 9am until 4pm.
I did try entering the following statement within the macro but I get the error message "compile error - arguement not optional"
Application.OnTime
TimeValue ("16:31:00"), "Mail_Selection_Range_Outlook_Body"
So here is my full macro. Thanks in advance for the help. (Using excel 2003)
Sub Mail_Selection_Range_Outlook_Body()
Dim rng As Range
Dim OutApp As Object
Dim OutMail As Object
Set rng = Nothing
On Error Resume Next
'Only the visible cells in the selection
Set rng = Sheets("Sheet1").Range("A1:C41").SpecialCells(xlCellTypeVisible)
'You can also use a range if you want
'Set rng = Sheets("YourSheet").Range("D4:D12").SpecialCells(xlCellTypeVisible)
On Error GoTo 0
If rng Is Nothing Then
MsgBox "The selection is not a range or the sheet is protected" & _
vbNewLine & "please correct and try again.", vbOKOnly
Exit Sub
View 9 Replies
View Related
Oct 17, 2008
I'm using this to unhide rows one at a time:
View 4 Replies
View Related
Dec 23, 2009
I need a macro to run at a certain time on Wednesday's, and then a certain time on the other days.
I would like to use a cell to reference that time, but right now, I am just hard coding it, but I an not get it to run.
Ultimately what I am looking for is something like this: ....
View 12 Replies
View Related
Feb 13, 2009
In trying to set up a structure for a bigger and better worksheet, I've come up against a problem that doesn't make sense to me: When the Worksheet is activated, the startTimer sub is in fact run with the OnTime application. But I keep getting the error message "Macro MakeNote not found," when that macro is in fact right there.
The code is very simple:
Sub Worksheet_Activate()
startTimer
End Sub
Sub startTimer()
Application.OnTime Now + TimeValue("00:00:01"), "MakeNote"
End Sub
Sub MakeNote()
ActiveSheet.Cells(6, 5).Value = "YES"
End Sub
Sub TimerExpired()
checkNewBar
End Sub
Sub checkNewBar()
ActiveSheet.Cells(4, 1).Value = "123"
End Sub
A second question: witll the TimerExpired macro run all by itself when the Timer expires, or do I need to do something special ?
View 9 Replies
View Related
Nov 3, 2006
I am running a timer in XL using the Application .OnTime Method.
Everywhere I've looked tells me that the procedure to stop the timer is
Sub StopTimer()
On Error Resume Next
Application.OnTime earliesttime:=RunWhen, procedure:=cRunWhat, schedule:=False
End Sub
I have this code in with the timer, but when I hit F5 or go to Tools--->Macros--> and Run the StopTimer Macro the timer just keeps running.
how I can properly call this procedure and stop the timer?
View 9 Replies
View Related
Mar 1, 2007
I have 80 worksheets in my workbook, each worksheet contains a table which must be updated on the first day of each month. On each sheet I need vba to duplicate the value in cell A10 to replace the next zero value in column E; duplicate the value in cell F10 to replace the next zero value in column J. Then, continue the same operation on the next sheet.
View 3 Replies
View Related
Apr 26, 2007
how to repeat the following line?
Private Sub Workbook_Open()
Application .OnTime TimeValue("22:02:00"), "Email"
so that everyday it runs at the same time Everyday? At the moment i have to close the workbook at somepoint during the day then relaunch so that it picks this line up, when this eventually "goes live" it will not be monitored as closely as it does now during testing.
View 2 Replies
View Related
May 25, 2007
I'm using Application OnTime to fire a procedure every 30 mins. It works great, but the workbook tries to reopen itself when i close it (but not if i close excel entirely). I assume this is because I haven't stopped it anywhere. So I put a call to a procedure that has: Application.OnTime RunWhen, cRunWhat, , False
In the "Workbook_BeforeClose" event. This doesn't solve the problem. What am I missing?
Private Sub Workbook_BeforeClose(Cancel As Boolean)
StopTimer
End Sub
Private Sub Workbook_Open()
StartTimer
End Sub
(module1)
Public RunWhen As Double
Public Const cRunIntervalSeconds = 1800 ' thirty mins
Public Const cRunWhat = "dothis"...............................
View 8 Replies
View Related
Sep 6, 2007
currently i have this:
Sub StartCycleB()
ActiveWorkbook.UpdateLink Name:="c:/a/b/c/test.xls", Type:=xlExcelLinks
RunWhen = Now + TimeSerial(0, 15, 0)
Application .OnTime RunWhen, "MyMacro", , True
End Sub
Works fine. Its updating and refreshing a file every 15 minutes. When a cell in the test.xls changes to TRUE, my sheet picks it up and changes to TRUE also.
So here is the problem: Once my sheet changes to TRUE, another macro activates in my sheet. This macro will automatically activate every 15 minutes if value is TRUE. BUT the problem is i ONLY WANT TO ACTIVATE THIS MACRO ONCE a day IF the value in my sheet is TRUE. So in summary how do i activate a macro based on a TRUE value on a cell, to happen ONCE a day and then stop?
View 3 Replies
View Related
Jul 24, 2013
I just can't seem to get the syntax correct for setting or resetting a cell value using the OnTime schedule function. It looks like the cell value changes randomly and after several cycles it just runs non-stop very, very quickly and I have to use the ESC key to break out of the loop.
Here is my code:
VB:
Sub RunOnTime()
dTime = Now + TimeValue("00:00:10")
Application.OnTime dTime, "RunOnTime"
If Cells(1, 4).Value <= Cells(6, 2).Value Then
Cells(1, 4).Value = Cells(1, 4).Value + 1
[Code]...
View 1 Replies
View Related
Jul 28, 2009
I didn't receive a response to a previous post where I was trying to use a batch file to close and open a workbook at a scheduled time everyday. I was thinking about this problem over the weekend, and thought that it would probably be easier to just use a macro to close the file at a certain time everyday (if it is open) and then use a batch file to open the file a couple of minutes later.
I'm having problems with what I thought should be pretty simple though. I tried this to close the file at 5:15pm
View 14 Replies
View Related
Feb 9, 2012
How to correct the code below so that OnTime is cancelled when the workbook is closed?
Error on bold line is Run-time error '1004': Method 'On Time' of object'_Application' failed
Code:
Public RollTime As Date, CalculateTime As Date, RefreshTradesTime As Date
Sub CancelOnTimeProcess()
SetTimesForRoll
With Application
.OnTime RollTime, "RollMacro", , False
.OnTime CalculateTime, "AutoCalculation", , False
.OnTime RefreshTradesTime, "UpdateLinks", , False
[Code] .......
CancelOnTimeProcess is being called when the user closes the workbook:
Code:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
CancelOnTimeProcess
End Sub
View 2 Replies
View Related
Jul 23, 2013
I just can't seem to get the syntax correct for setting or resetting a cell value using the OnTime schedule function.
It looks like the cell value changes randomly and after several cycles it just runs non-stop very, very quickly and I have to use the ESC key to break out of the loop.
Here is my code:
Code:
Sub RunOnTime()
dTime = Now + TimeValue("00:00:10")
Application.OnTime dTime, "RunOnTime"
If Cells(1, 4).Value
View 5 Replies
View Related
Aug 26, 2008
I have a splash screen (user form) which displays fo a number of seconds. The UserForm_Activate routine uses Application.OnTime to run the KillSplash subroutine, which is defined in Module1. Thing is, I would like to move the "KillSplash" routine to the UserForm module. What should be the full name of KillSplash I need to pass to OnTime? What "trick" do I use to make "KillSplash" visible to Application.OnTime?
View 9 Replies
View Related