I need a macro that will take a list of 42 names and 27 locations. The names are broken down into group of shifts, 1 shift, 2nd shift and 3rd shift. We need to perform audits on the 27 locations in groups of 2 people at a time. What I'd like is a macro that would take all the names by shift and assign 2 random people to a location. All 27 locations have to be audited each week (safety), and a report filled out and turned into our safety committee. I would like to post the audit sheet with the macro on our shared drive. Can anyone help me with this.
I have a work sheet with about 35,000 lines of data. Every day I have to sort the list by product category (I use auto filter to separate) and then copy the results into a new worksheet, there are about 300 product catagories. I'm new to macros but I'm wondering if there is a macro that can automate this process.
i have a made a macro that copies info to a new sheet now that is working great but if i change the name of the work book it wont work any more so i need the macro to work with what ever name i give the workbook
the current name is
AVERAGE PRICE (update 2009) Mimmos Armico 170809.xls
In the attached WB - the formula, in Col. "D", seems to be too long - although returning the expected result. Could somebody lighten my eyes with a much shorter formula ?
I written VBA code to create a new sheet and embed a command button on it. I want to assign a macro to this button but when I click on the button the assign macro button is greyed out. I have plenty of macros saved and the VBA code has finished running so why should this be?
In a sheet, like the example, I have monthly shift schedules for employees. What I want is to count the total shifts for Saturday and Sunday, separately Night (N) and Morning (M)/Afternoon (A) shifts, as in columns with red.
ABCDEMNOPQRAGAHAIAJ1JUNE 20132DATE1234121314151617.... HOW MANY "N" HOW MANY "M" AND "A"3SATSUNMONTUEWEDTHUFRISATSUNMON.... AT SAT-SUNAT SAT-SUN4Employee1NNNNNMM--A205Employee2MMMM-NNNNN246 Employee3AAAAM--MMM067Employee4--MM-AANNM408............................................9EXAMPLE
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.
While practicing writing macros and studying the VBA code, I decided to add a button to run the macro, something I've done many times in the past. But the option to associate the new button with any macro doesn't seem to be available.
From the Control Toolbox I click on the command button icon. I positon the mouse where I'd like to place the command button and draw the command button. Then right click to open the drop down menu. A few days ago in the drop down menu I had an option Assign Macro but now I don't have it anymore. How is it possible to assign macros to the command button and even better how can I get the Assign Macro option back in the drop down menu?
I have designed a functioning userform which transfers the data (limited or complete) into the sheet. Along with the data and at the end of each row it automatically generates 4 checkboxes and links them to 4 offset cells.
This is where I hit a dead end. I am not sure which avenue is suitable or indeed possible. I want to click any checkboxes in the first COLUMN and as a result have it change the complete ROW colorindex of the background. I did achieve this with conditional formatting but it seemed to make the empty sheet bulking when saving and I cannot alter the font size which is another goal on the 3rd column of checkboxes. Am I waffling yet?
The 3rd column checkboxes I want to have the ROW font size drop to 3pt. The 2nd and 4th currently serve no purpose i.e. trigger nothing as a result.
I don’t think I can use the checkbox_click event as the boxes are generated for me so I don’t know which number they will be. The worksheet_change event and calculate event don’t seem to register when the linked cell goes to TRUE or back to FALSE. I tried using FORMS and CONTROLS checkboxes but neither has brought me success.
I was hoping the linkedcell would trigger an event and in turn select and manipulate the entire row in which the linked cell is located….
Due to my limited knowledge the code I have written/adapted to suit my needs may appear a little unorthodox? I hope that in itself is not a problem.
I have not managed to get the Controls Checkboxes to initalise blank. Currently they appear greyed out with a tick but fully usable? Of minor importance.
I can't attach the file because the blank sheet is 4.5MB?? so here is the main body of code from the userform. If you need anything else I will supply as required, however I can't get anyfiles under the attachment maximum of 48.8kb. My jpeg image was 108kb....
I have table and need to take out montly total for each worker...
Now... Each hours in day have own factor. (I need total hours per day but for illustration)...
So when worker works day shift from 8:00 to 16:00 it's easy... 8 hours When works from 8:00 to 20:00 it's 8 hours + 4 afternoon hours When works from 20:00 to 8:00 it's 2 afternnoon hours + 8 night hours + 2 day hours
Aditional problem is when day intercept holliday or sunday when that factors need to be included (if holliday is at sunday then it's like holliday).
Here is some attachment:
Book1.xls
I've also added last day of previous month and first day of next month because of night shifts than need to be calulcated. Therefore correct number of hours is 168 and not 188.
Below I calculated manually those numbers wich I want to be automated...
Also.. This is table I get.. If it's easier to make it somehow else, OK by me. And any number of aditional columns is not problem...
I would like to run some code against the currently selected range of cells in the worksheet, but when I click on the VB button that runs the code, the focus shifts from the worksheet to the VB app, and the cells in the worksheet are no longer selected.
I know this is probably not a question that's come up before, but does anyone have any idea how to retain the 'selected' status of the cells in the worksheet ?
This problem started after a lot of development of various macros in a moderate sized workbook. I've gone back to various stages of development and am unable to find what is causing this one worksheet tab to jump to the beginning of the cue (to the left) when i first click on that tab.
Thought the most likely culprit was a worksheet change macro, but even after deleting that, the behaviour persisted.
I have checkboxes (from the control toolbox) in a spreadsheet next to text. When I am in the normal view everything is where it is supposed to be. But when I do a print preview the checkbox shifts and comes on top of the text that was at the left of the checkbox.
This form has to be presentable both on paper and electronically. So both views are important.
I have to modify 2000 files so I've written a master file that loops through a list, importing modules and forms into the 2000 files it opens and closes. On each file when open it draws a button on worksheet. I then want to assign a macro to the button called "ModifyMenu" . The code for 'Modifymenu' is imported into file_01.xls and is a unique name. It does not exist is master.xls, so no confusion.
The code for assigning the code is as follows :
Windows("file_01.xls").Activate ActiveSheet.Shapes("Button").Select or Workbooks("file_01.xls").Sheets("1 B").Shapes("Button").Select
Then
Selection.OnAction = "ModifyMenu" (This links to master.xls!ModifyMenu not file_01.xls)
Selection.OnAction = "file_01.xls!ModifyMenu" (This fails, runtime 1004. 'Unable to set the OnAction property of the button class)
Selection.OnAction = ThisWorkbook.Name & "!ModifyMenu" (This links to master. MAster is the active code even though 'file_01.xls' is the active worksheet)
Variations on the above seem to result in the same 1004 error or linking back to master regardless of the fact I'm trying to link to file_01.xls.
My macro essentially requires a deletion of the entire sheet, so I cannot run it through a button, it'd by definition be deleted. So I was thinking to run this macro through the keyboard, how to assign a keyboard key to existing macro?
i want to know how to assign a macro which will remove and place a number in a certain cell. so if i click and tick the box, then a certain figure will come into a cell(this will be a formulae) and when untick the the number will disappear.
I have several Activex buttons in sheet "Options" and I would like to automatically assign each button to the same macro "Run_Options", in order to execute the macro "Run_Options" when I do click over any button.
I have a start page in the beginning of my excel workbook. This is where i want to assign a macro to a search button. I want the macro to search the entire workbook but only in a certain block on each worksheet.
I'm currently working with MS Excel 2010 and have a document full of people with their working hours. So their start time and their end time. Now these people should get a monetary reward dependent on the different time shifts they work in. For example, someone is scheduled for a shift starting at 6:00 AM (cell A1) until 20:00 PM (Cell B1). His actual clocking-in time is 5:48 AM (Cell C1) and clocking-out time is 19:58 PM (Cell D1). There are three shift reward types:
1) Shift Regular (E1): From 7:00 AM until 18:00 PM 2) Shift night (F1): From 18:00 PM until 0:00 AM 3) Shift midnight (G1): From 0:00 AM until 7:00 AM
How can create a formula in cell E1, F1 and G1, which will first look at the actual clocking-in time and scheduled time and will say 5:48 AM is too early as you start at 6:00 AM, so 1 hour in cell G1, and 11 hours in cell E1 and 2 hours in F1 (should automatically round up 19:58 to 20:00). However, after 4 hours work someone will get 0:30 hours lunch break, which should be deducted in E1 as well. And as mentioned earlier actual clocking time should be round up to 15 minutes, so 19:53 should be 20:00 and 6:13 should be 6:15.
Also note that the cells with time are in TIME and should become numbers (e.g. 7,5 hours) in cells E1, F1 and G1.
I also added an attachment, which shows what I would like to retrieve automated in the RED boxes.
I am developing a report that tracks the efficiency of industrial sorters on an automated assembly line. The line runs around the clock in three shifts (1: 7:30am to 3:29pm, 2: 3:30pm to 11:29pm, and 3: 11:30pm to 7:29am), and collects certain performance indicators, such as units processed. I am trying to calculate the units processed during each shift on each day. For example, if a run ran from 2:30 pm to 4:30 pm, and processed 100 units, I would want 50 units credited to shift 2 and 50 units to shift 3 (we are assuming a steady rate of processing).
My data arrives from the machine with the following columns (each run is a separate row):
B|D|E|G|H Run #| Start Date| Start Time| Units Processed | End date | End Time
I have successfully used the start time to determine the starting shift with IF statements:
=IF(--E3<0.3125,3,(IF(--E3<0.6458,1,(IF(--E3<0.9792,2,3))))) and a similar formula to calculate the end shift. This works fine if the run only spans two shifts within the same day.
My problem is that some of the runs, run across more than one shift and even across days. For example, a run that ran from 10:30 pm on one day to 4:30 pm on the next, would overlap 5 shifts and two days. I need to be able to figure out the proportion of time spent on each shift, and use that to get the proportion of units processed during each shift on each day.
I am currently thinking of a convoluted series of nested IF statements (and generating lots of columns to the right of my data for each potential shift within a run), but this seems inelegant and cumbersome. Is there a more logical way to approach this? Even more specifically, is there a function that can pair my start/end dates and times with a set of shift start/end times and calculate the elapsed time for each shift within a run? Something with MATCH or VLOOKUP maybe?
We have a person who work in 24/7 support. One person work passive 24 hour, but it 24 hours are divided in to next shifts: normal 06-18, over hours 18-22, night hours 22-06.So if we have some one who is supporting client say from 17h till 23h, we have next results:
Name Start time End Time 06:00 - 18:00 18:00 - 22:00 22:00 - 06:00
John 17:00 23:00 1:00 4:00 1:00
Is it possible to in time range enter formula who subtracted end time from start time, but taking into account 24 hours?
User inputs cost in a cell then clicks macro button that will run a macro that ask for a task description. The user inputs the task info that relates to the cost (i.e. weld pipe). This data is stored on a seperate sheet in the corresponding cell (cost is on sheet "hours" and task description is on sheet "task description" both in same cell. This allows a copy of the cost sheet to reflect the task description. I have tried recording macros but can't get anywhere.
I created a drop down list (of various Input Groups) and I need to show the selected group's responsibilities on a separate sheet; is there an easy way to do this?
I have two files, a workbook and a document, and both are macro-enabled files. The workbook is my main file for my project and the document is my template. The workbook is basically my database with vba program that populate data to Word document. My word document is a template that has macros saved in a module. Aside from populating the data, workbook also create formfields on to the document and assign macro (ExitMacro).
However, i'm getting Run-time error (4210): Bad parameter message when i try to assign the macro to formfields. I noticed that this happened when the macro was saved in the module of the document. The workbook program works fine if the document macro was saved in Normal.dot, which i don't want to do.